spread vs apply

Benchmark created on


Setup

const args = Array.from(Array(500000).keys())

function bigBoy(...nums) {
	return nums.reduce((a,b) => a*b);
}

Test runner

Ready to run.

Testing in
TestOps/sec
spread
function useSpread() {
	return bigBoy(...args);
}
ready
apply
function useApply() {
	return bigBoy.apply(args)
}
ready

Revisions

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