saving len

JavaScript performance comparison

Test case created by

Preparation code

<script>
  
  var i = 0;
  var len = 1000;
  
  var array = [];
  var out = [];
  
  for (i=0;i<len;i++){
    array.push(i);
  }
</script>
    

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
Normal
out = [];
for (i=0;i<array.length;i++){
  out.push(array[i]);
}
pending…
Saved
out = [];
for (i=0, len=array.length;i<len;i++){
  out.push(array[i]);
}
pending…

Compare results of other browsers

Revisions

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

0 Comments