pre-allocated arrays (v46)

Revision 46 of this benchmark created by Lee Byron on


Test runner

Ready to run.

Testing in
TestOps/sec
empty literal
var arr = [];
for (var i = 0; i < 32; i++) {
    arr[i] = i;
}
ready
pre-allocated array
var arr = new Array(32);
for (var i = 0; i < 32; i++) {
    arr[i] = i;
}
ready
holey array
var arr = [,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]
for (var i = 0; i < 32; i++) {
    arr[i] = i;
}
ready
nully array
var arr = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]
for (var i = 0; i < 32; i++) {
    arr[i] = i;
}
ready

Revisions

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