asdf

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var o = {
      "0": "a",
      "1": "b",
      "2": "b",
      "3": "b",
      "4": "b",
      "5": "b",
      "6": "b",
      "7": "b",
      "length": 8,
      "xy": function(asdf) {}
    };
    var arr = new Array();
};
</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
v1
for (var i in o)
if (++i) arr.push(o[i - 1])
pending…
v2
for (var i in o)
if (+i || i == "0") arr.push(o[i])
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