loopArray

JavaScript performance comparison

Test case created by

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var trray = [];
  for(var i = 0; i <10000; i++){
      trray[i] = 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
defined length
for (var i = 0, len = trray.length; i < len; i++) {
  console.log(trray[i])
}
pending…
no undefined length
// async test
for (var i = 0, i < trray.length; i++) {
  console.log(trray[i])
}
pending…
defined length gobal
var len = trray.length;
for (var i = 0; i < len; i++) {
  console.log(trray[i])
}
pending…

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

0 Comments