infinity

JavaScript performance comparison

Revision 10 of this test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var c = -10;
    var d = 10;
};
</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
const
var a = Number.POSITIVE_INFINITY,
    b = Number.NEGATIVE_INFINITY;



if (c > b) {
  if (d < a){
    return 'test 1';
  }
}
pending…
divide by zero
var a = 1/0,
    b = -1/0;

if (c > b) {
  if (d < a){
    return 'test 2';
  }
}
pending…
infinity const
var a = Infinity,
    b = -Infinity;

if (c > b) {
  if (d < a){
    return 'test 3';
  }
}
pending…
const, b = -a
var a = Number.POSITIVE_INFINITY,
    b = Number.NEGATIVE_INFINITY;

if (c > b) {
  if (d < a){
    return 'test 4';
  }
}
pending…
divide by zero, b = -a
var a = 1/0,
    b = -a;

if (c > b) {
  if (d < a){
    return 'test 5';
  }
}
pending…
infinity const, b = -a
var a = Infinity,
    b = -Infinity;

if (c > b) {
  if (d < a){
    return 'test 6';
  }
}
pending…
Math.min, b = -a
var a = Math.min(),
    b = Math.max();

if (c > b) {
  if (d < a){
    return 'test 7';
  }
}
pending…
MAX_VALUE
var a = Number.MAX_VALUE,
    b = -Number.MAX_VALUE

if (c > b) {
  if (d < a){
    return 'test 8';
  }
}
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