Increment vs Decrement 2

JavaScript performance comparison

Revision 2 of this test case created by zaus

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var values = [1,2,3,4,5];
  function process() {
  };

};
</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
Increment
for (var i=0; i <= values.length - 1; i++) {
   process(values[i]);
}
pending…
Decrement
for (var i=values.length - 1; i >= 0; i--) {
   process(values[i]);
}
pending…
Increment, correct terminal
for (var i=0; i < values.length; i++) {
   process(values[i]);
}
pending…
Increment, memoized terminal
for (var i=0, end=values.length; i < end; i++) {
   process(values[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