Comparison of comparisons

JavaScript performance comparison

Revision 9 of this test case created by Lil Devil

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var teststr = "test text",
        testnum = 132013223,
        teststrnum = "132013223";
};
</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
== String (true)
(teststr == "test text");
pending…
=== String (true)
(teststr === "test text");
pending…
== String (false)
(teststr == "not test text");
pending…
=== String (false)
(teststr === "not test text");
pending…
== Number (true)
(testnum == 132013223);
pending…
=== Number (true)
(testnum === 132013223);
pending…
== Number (false)
(testnum == 13201322);
pending…
=== Number (false)
(testnum === 13201322);
pending…
string == number (true)
(teststrnum == testnum);
pending…
string === number (true)
(teststrnum === testnum);
pending…
string == number (false)
(teststr == testnum);
pending…
string === number (false)
(teststr === testnum);
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

Comment form temporarily disabled.

Add a comment