array vs uint32array (v6)

Revision 6 of this benchmark created by ikarienator on


Setup

var total = 1000;
    var a = new Array();
    var b = new Uint16Array(total);
    var c = function () {
      // debugger;
    };
    for(var i=0; i<total; i++){
    a[i] = i;
    b[i] = i;
    }

Test runner

Ready to run.

Testing in
TestOps/sec
access array
for(var i=0; i<total; i++){
c(a[i]);
}
ready
access Uint32array
for(var i=0; i<total; i++){
c(b[i]);
}
ready
set Array
for(var i=0; i<total; i++){
c(a[i] = i);
}
ready
set Uint32array
for(var i=0; i<total; i++){
c(b[i] = i);
}

 
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.