loop object

Benchmark created on


Setup

const obj = {}
let i = 100
while (i--) {
	obj['key' + i] = i
}

Test runner

Ready to run.

Testing in
TestOps/sec
default loop
let i = 1000
while (i--) {
	for (const key in obj) {
		const res = obj[key] + ''
	}	
}
ready
entries loop
let i = 1000
while (i--) {
	for (const [key, val] of Object.entries(obj)) {
		const res = val + ''
	}
}
ready

Revisions

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