Array Performance

JavaScript performance comparison

Revision 243 of this test case created by

Preparation code

<script>
  Benchmark.prototype.setup = function() {
    var a = [29938,32994];

    var o = {};
    o.x29938 = 29938;
    o.x32994 = 32994;
  };
</script>
    

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Manual Array Lookup
var result = a.indexOf(29938);
pending…
Object
var result = o.x29938;
pending…
Object by Key
var id = 'x29938';
var result = o[id];
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.

0 Comments