call vs apply

Benchmark created on


Setup

const args = Array.from({ length: 10000 }, (_, i) => i);
function func() {
	console.log(arguments.length)
}

Test runner

Ready to run.

Testing in
TestOps/sec
apply
func.apply(null, args);
ready
call with spread
func.call(null, ...args);
ready

Revisions

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