Disable TypedArray support for now (still slower than the default Memory implementation)

This commit is contained in:
Jeff Parsons 2014-10-12 13:41:37 -07:00 • committed by jeffpar
commit 93f5999b03
8 changed files with 1611 additions and 1607 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -755,10 +755,13 @@ CPU.prototype.setSpeed = function(nMultiplier, fOnClick)
*/ */
if (this.mhz/this.mhzTarget < 0.8) nMultiplier = 1; if (this.mhz/this.mhzTarget < 0.8) nMultiplier = 1;
this.nCyclesMultiplier = nMultiplier; this.nCyclesMultiplier = nMultiplier;
this.mhzTarget = this.mhzDefault * this.nCyclesMultiplier; var mhz = this.mhzDefault * this.nCyclesMultiplier;
if (this.mhzTarget != mhz) {
this.mhzTarget = mhz;
var sSpeed = this.getSpeedTarget(); var sSpeed = this.getSpeedTarget();
if (this.bindings["setSpeed"]) this.bindings["setSpeed"].innerHTML = sSpeed; if (this.bindings["setSpeed"]) this.bindings["setSpeed"].innerHTML = sSpeed;
this.println("target speed: " + sSpeed); this.println("target speed: " + sSpeed);
}
if (fOnClick) this.setFocus(); if (fOnClick) this.setFocus();
} }
this.addCycles(this.nRunCycles); this.addCycles(this.nRunCycles);

View file

@ -99,14 +99,19 @@ var FASTDISABLE = false;
var FATARRAYS = false; var FATARRAYS = false;
/** /**
* TYPEDARRAYS enables use of typed arrays for Memory blocks. This used to be a compile-time * option, but since I've * @define {boolean}
*
* TYPEDARRAYS enables use of typed arrays for Memory blocks. This used to be a compile-time-only option, but since I've
* added memory access functions for typed arrays (see Memory.afnTypedArray), I can turn the support on dynamically now. * added memory access functions for typed arrays (see Memory.afnTypedArray), I can turn the support on dynamically now.
* Originally, I didn't see much of a speed increase over the original (non-typed) implementation, but that will probably * Originally, I didn't see much of a speed increase over the original (non-typed) implementation, but that will probably
* change over time. * change over time.
* *
* See the Memory component for details. * See the Memory component for details.
*
* UPDATE (Oct 2014): Time has passed, and TypedArray support is still measurably slower than the default Memory implementation,
* so it's turned off by default for now.
*/ */
var TYPEDARRAYS = (typeof ArrayBuffer !== 'undefined'); var TYPEDARRAYS = false; // (typeof ArrayBuffer !== 'undefined');
if (typeof module !== 'undefined') { if (typeof module !== 'undefined') {
global.PCJSCLASS = PCJSCLASS; global.PCJSCLASS = PCJSCLASS;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long