Object.entries

Benchmark created on


Setup

const items = new Map();
items.set('a', 1)
items.set('b', 1)
items.set('c', 1)
items.set('foo', 'bar')

Test runner

Ready to run.

Testing in
TestOps/sec
Inside
for (const [key, value] of items.entries()) {
	const x = key + value; // some illusion of work
}
ready
Outside
const entries = items.entries();
for (const [key, value] of entries) {
	const x = key + value; // some illusion of work
}
ready

Revisions

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