Loop performance (v5)

Revision 5 of this benchmark created on


Setup

var setup = {};

setup.items = [];
setup.object = {};
setup.count = 0;
setup.length = 100000000
for(const i = 0; i < length; i++) {
	const sample = { a: 'test', b: i };
	setup.items.push(sample);
	setup.object[`test-${i}`] = sample;
}
setup.values = Object.values(setup.object);


Teardown

setup = null;

Test runner

Ready to run.

Testing in
TestOps/sec
key in
for(const item of setup.values) {
	
}
ready
for i
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.