Object Iteration

Benchmark created on


Setup

const object = Object.fromEntries(Array.from({length: 5000}, () => [String(Math.random()), Math.random()]))

Test runner

Ready to run.

Testing in
TestOps/sec
for entries
let sum = 0;
for (const [key, value] of Object.entries(object)) {
	sum += value;
}
ready
for keys
let sum = 0;
for (const key of Object.keys(object)) {
	sum += object[key];
}
ready

Revisions

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