Loop performance (v7)

Revision 7 of this benchmark created on


Setup

var setup = {};

setup.items = [];
setup.object = {};
setup.count = 0;
setup.length = 100000000
setup.map = new Map();

for(const i = 0; i < length; i++) {
	const sample = { a: 'test', b: i };
	setup.items.pu
	sh(sample);
	const key = `test-${i}`;
	setup.object[key] = sample;
	setup.map.set(key, sample);
}
setup.values = Object.values(setup.object);


Teardown

setup = null;

Test runner

Ready to run.

Testing in WebKit 537.36 / undefined
TestOps/sec
item in map
for(const [key, item] of setup.map) {
	
}
ready
key in object
for(const key in setup.object) {
	const item = setup.object[key];
}
ready

Revisions

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