Reducer perf

Benchmark created on


Setup

const arr = Array.from({length: 1000}).map((_, i) => i * i)

Test runner

Ready to run.

Testing in
TestOps/sec
Spread accumulator
arr.reduce((acc, curr) => [...acc, curr], [])
ready
Push in accumulator
arr.reduce((acc, curr) => {
	acc.push(curr)
	return acc
}, [])
ready

Revisions

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