loop for var

JavaScript performance comparison

Test case created by Viktor

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
var before
var array = new Array();
  var i;
  for (i = 0; i < 1000000; i++) {
    array.push(i);
  }
pending…
var inside
var array = new Array();
  for (var i = 0; i < 1000000; i++) {
    array.push(i);
  }
pending…
var before. 2
var array = new Array();
  var i=0;
  for (; i < 1000000; i++) {
    array.push(i);
  }
pending…
let before. 2
let array = new Array();
  let i=0;
  for (; i < 1000000; i++) {
    array.push(i);
  }
pending…
let before
let array = new Array();
  let i;
  for (i = 0; i < 1000000; i++) {
    array.push(i);
  }
pending…
let inside
let array = new Array();
  for (let i = 0; i < 1000000; i++) {
    array.push(i);
  }
pending…

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

0 Comments