Created
July 11, 2016 10:22
-
-
Save smvv/b7605d45e864a290d8186f0c83381652 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Length Normal arrays TypedArrays (before) TypedArrays (after) | |
Small (4) 340 ms 2400 ms 96 ms | |
Large (16) 510 ms 7900 ms 280 ms | |
Dynamic 5500 ms 12300 ms 1900 ms |
This file contains hidden or 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() { | |
for(var i=0;i<10000000;i++) { | |
var len = (i & 0xff) + 2 | |
arr = new Float64Array(len); | |
//var arr = []; | |
//for (var c = 0; c < len; c++) | |
// arr[c] = 0.; | |
arr[0] = 1.2; | |
if (arr[0] === arr[1]) | |
print('fail'); | |
} | |
})(); |
This file contains hidden or 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() { | |
for(var i=0;i<10000000;i++) { | |
var a = new Float64Array(16); | |
//var a = [.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0] | |
a[0] = 1.2; | |
if (a[0] === a[1]) | |
print('fail'); | |
} | |
})(); |
This file contains hidden or 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() { | |
for(var i=0;i<10000000;i++) { | |
var a = new Float64Array(4); | |
//var a = [.0,.0,.0,.0] | |
a[0] = 1.2; | |
if (a[0] === a[1]) | |
print('fail'); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment