comparation on blucle

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var obj = {
      "a": "12",
      "b": "3s",
      "c": "a2",
      "d": "4x",
      "e": "d3",
      "f": "12",
      "g": "3s",
      "h": "a2",
      "i": "4x",
      "j": "d3",
      "k": "12",
      "l": "3s",
      "m": "a2",
      "n": "4x",
      "o": "d3",
      "p": "4s",
      "q": "12",
      "r": "3s",
      "s": "a2",
      "t": "4x",
      "u": "12",
      "w": "3s",
      "x": "a2",
      "y": "4x",
      "z": "d3"
    };
    var vC = "c";
    var vV = true;
    var f1 = function() {};
    var f2 = function() {};
};
</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
on
for (var key in obj) {
  if (key !== vC) {
    if (vV === true) {
      f1();
    } else {
      f2();
    }
  }
}
pending…
out
if (vV === true) {
  for (var key in obj) {
    if (key !== vC) {
      f1();
    }
  }
} else {
  for (var key in obj) {
    if (key !== vC) {
      f2();
    }
  }
}
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