Comparison of == and === performance

JavaScript performance comparison

Test case created by onionhammer

Info

Compares the performance between == and ===

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var v = "a",
        w = "this is another test",
        x = 5,
        y = 8,
        z = "this is a test";
};
</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
==
var result1 = v + w == "athis is another test";
var result2 = x == y;
var result3 = w == z;
pending…
===
var result1 = v + w === "athis is another test";
var result2 = x === y;
var result3 = w === z;
pending…

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

Compare results of other browsers

0 comments

Add a comment