Inequality vs. greater than

JavaScript performance comparison

Revision 2 of this test case created by XP1

Info

See http://stackoverflow.com/questions/7637934/is-there-a-performance-difference-in-javascript-between-and.

Preparation code

<script>
  var i = 6;
  var j = 9;
</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
i < j
if (i < j) {}
pending…
i <= j
if (i <= j) {}
pending…
i < 0
if (i < 0) {}
pending…
i <= 0
if (i <= 0) {}
pending…
i > 0
if (i > 0) {}
pending…
i >= 0
if (i >= 0) {}
pending…
i != 0
if (i != 0) {}
pending…
i !== 0
if (i !== 0) {}
pending…
i > j
if (i > j) {}
pending…
i >= j
if (i >= j) {}
pending…
i != j
if (i != j) {}
pending…
i !== j
if (i !== j) {}
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