map vs arr

Benchmark created on


Setup

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

Test runner

Ready to run.

Testing in
TestOps/sec
arr
arr[8356] = 0x010;
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.