n-length-array

JavaScript performance comparison

Revision 5 of this test case created by

Preparation code

 <script src="https://cdn.jsdelivr.net/lodash/3.6.0/lodash.min.js"></script>

    

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
simple while
var i = 0, upper = 24;
var a = [];

while (i < upper) {
  a.push(i);
  i++;
}
pending…
predefined array while #2
var i = 0, lower = 24, upper = 48;
var length = upper - lower;
var a = [length];

while (i < length) {
  a[i] = lower;
  lower = i++;
}
pending…
predefined array while
var i = 0, lower = 24, upper = 48;
var length = upper - lower;
var a = [length];

while (i < length) {
  a[i] = lower;
  lower++;
  i++;
}
pending…

Revisions

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

0 Comments