Map Iteration

JavaScript performance comparison

Test case created

Preparation code

Benchmark.prototype.setup = function() {
    var o = {};
    var m = new Map();
    var keys = ['foo', 'bar', 'test', 'case', 'bring', 'it', 'down'];
    var numKeys = keys.length;
    var n;
    for (n = 0; n < numKeys; n += 1)
      o[keys[n]] = n;
      m[keys[n]] = n;

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
var p, r;
r = 0;
for (p in o)
  r += o[p];
var p, r;
r = 0;
for (p in m)
  r += m[p];

Compare results of other browsers


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:

1 comment

Erik Arvidsson commented :

This does not test Map iteration

Comment form temporarily disabled.

Add a comment