DoubleNumber comparison speed

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var x1 = 42;
    var x2 = 5e-324;
    var x3 = Infinity;
    var x4 = NaN;
    var x = 100.5;
   
};
</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
Normal
x = 200 - x;
if (x == x1) { throw 42; }
pending…
Denormal
x = 200 - x;
if (x == x2) { throw 42; }
pending…
Infinity
x = 200 - x
if (x == x3) { throw 42; }
pending…
NaN
x = 200 - x;
if (x == x4) { throw 42; }
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