pre-allocated arrays (v6)

Revision 6 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
empty literal
var arr = [];
for (var i = 0; i < 100000; i++) {
    arr[i] = i;
}
ready
pre-allocated array (sparse)
var arr = new Array(100000);
for (var i = 0; i < 100000; i++) {
    arr[i] = i;
}
ready
pre-allocated array (dense)
var arr = Array.apply(null, new Array(100000));
for (var i = 0; i < 100000; i++) {
    arr[i] = i;
}
ready

Revisions

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