Loop Counter

JavaScript performance comparison

Revision 11 of this test case created by Ben Blank

Info

check += against +

Preparation code

<script>
  var l_count1 = 0;
  var l_count2 = 0;
  var l_count3 = 0;
  var l_count4 = 0.5;
  var l_count5 = 0.5;
  var l_count6 = 0.5;
  var l_count7 = 4294967296;
  var l_count8 = 4294967296;
  var l_count9 = 4294967296;
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
int += 1
l_count1 += 1;
pending…
int + 1
l_count2 = l_count2 + 1;
pending…
int++
l_count3++;
pending…
float += 1
l_count4 += 1;
pending…
float + 1
l_count5 = l_count5 + 1
pending…
float++
l_count6++;
pending…
bigint += 1
l_count7 += 1;
pending…
bigint + 1
l_count8 = l_count8 + 1
pending…
bigint++
l_count9++;
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. Here’s a list of current revisions for this page:

0 comments

Add a comment