map vs arr (v4)

Revision 4 of this benchmark created on


Setup

var hash = {};
var m = new Map();
for(let i = 0; i < 100000; i++) {
  hash[`${i}`] = i;
  m.set(`${i}`, i);
}

Test runner

Ready to run.

Testing in
TestOps/sec
hash
Object.defineProperty(hash, "8356", { value: 0x010, writable: true });
ready
set
m.set("8356", 0x010);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.