reduce comparison

Benchmark created on


Setup

const testData = new Array(1000).fill({test:0});

Test runner

Ready to run.

Testing in
TestOps/sec
Reduce with immutable
testData.reduce((acc, value, index)=> {
	acc = [...acc, {test: index}];
	return acc;
}, [])
ready
Reduce with modification
testData.reduce((acc, value, index)=> {
	acc.push({test: index});
	return acc;
}, [])
ready

Revisions

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