pre-allocated arrays (v38)

Revision 38 of this benchmark created by Ivan on


Preparation HTML

<script>
var preAllocated = new Array(1000000);
var empty = [];
</script>

Setup

preAllocated = new Array(1000000);
  empty = [];

Test runner

Ready to run.

Testing in
TestOps/sec
empty literal
for (var i = 0; i < 1000000; i++) {
  empty[i] = 1;
}
ready
pre-allocated array
for (var i = 0; i < 1000000; i++) {
  preAllocated[i] = 1;
}
ready

Revisions

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