Array traversing asc desc

JavaScript performance comparison

Revision 6 of this test case created by Carlos Vázquez

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var i,
      le = 10000,
      array = Array(le);

};
</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
Descending
for(i = le - 1; i >= 0; i--) {
    array[i] = 0;
}
pending…
Ascending
for(i = 0; i < le; i++) {
    array[i] = 0;
}
pending…

Revisions

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

0 Comments