Destroy Destroy Destroy

JavaScript performance comparison

Test case created by Jonathan Perry

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var some = Object.keys({
       a: 1,
       b: 2,
       c: 3,
       d: 4,
       e: 5,
       f: function() {
        return 6;
       },
       g: [7, 8, 9]
      }),
      more = Array.prototype.slice.call(Object.keys({
       a: 1,
       b: 2,
       c: 3,
       d: 4,
       e: 5,
       f: function() {
        return 6;
       },
       g: [7, 8, 9]
      })),
      meat = Array.prototype.slice.call(Object.keys({
       a: 1,
       b: 2,
       c: 3,
       d: 4,
       e: 5,
       f: function() {
        return 6;
       },
       g: [7, 8, 9]
      })),
      s;
};
</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
Destroy Some
while (some.length) { 
  s = some.shift();
}
pending…
Destroy More
while (more.length) { 
  s = more.shift();
}
pending…
Destroy Meat
while (s = meat.shift());
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