array vs uint32array (v5)

Revision 5 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++){
a[i] = i;
}

c(a[0])
ready
set Uint32array
for(var i=0; i<total; i++){
b[i] = i;
}

c(b[0])
ready

Revisions

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