Adding Entries to a Map vs Adding Entries to an Object

Benchmark created by BretCameron on


Setup

let obj = {}, map = new Map(), n = 1000000;

Test runner

Ready to run.

Testing in
TestOps/sec
Adding entries to a Map
map.set(n, n);
ready
Adding entries to a regular object
obj[n] = n;
ready

Revisions

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

  • Revision 1: published by BretCameron on