literal vs array

Benchmark created on


Preparation HTML

<script>
  var literal = [];
  
  var arr = new Array(1000000);
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
literal
for (x = 0 ; x < 1000000 ; x++) {
  literal[x] = x;
}
ready
Array
for (x = 0 ; x < 1000000 ; x++) {
  arr[x] = x;
}
ready

Revisions

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