Last active
August 29, 2015 14:25
-
-
Save zbjornson/af5298f089c420f94d5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flip() { | |
var flipper = new Uint8Array(4 * 10000); | |
flipFloat(flipper, 10000, 4); | |
} | |
function flipFloat(flipper, iMax, eSize) { | |
for (var i = 0; i < iMax; i += eSize) { | |
var t = flipper[i]; | |
// Toggle this line: | |
if (t === undefined) {} | |
flipper[i] = flipper[i + 3]; | |
flipper[i + 3] = t; | |
var u = flipper[i + 1]; | |
flipper[i + 1] = flipper[i + 2]; | |
flipper[i + 2] = u; | |
} | |
} | |
flip(); | |
flip(); | |
%OptimizeFunctionOnNextCall(flip); | |
flip(); | |
console.log(%GetOptimizationStatus(flip)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With line 10 present:
With line 10 commented-out: