Object vs Map Mutation

Benchmark created on


Test runner

Ready to run.

Testing in WebKit 537.36 / undefined
TestOps/sec
Direct Object Mutation
let obj = {};
for (let i = 0; i< 50; i++) {
	obj[String(i)] = i;
}
ready
Map to Object Mutation
let map = new Map();
for (let i = 0; i< 50; i++) {
	map.set(String(i), i);
}
Object.fromEntries(map);
ready

Revisions

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