Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
rest args vs arguments, spread vs apply
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Browser:
Chrome 125
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
rest args spread
5085720.5 Ops/sec
rest args apply
2951917.0 Ops/sec
arguments spread
5207289.5 Ops/sec
arguments apply
2937542.8 Ops/sec
Script Preparation code:
let c1 = 0; function f1() { 'use strict'; c1++; } let c2 = 0; function f2() { 'use strict'; c2++; } let c3 = 0; function f3() { 'use strict'; c3++; } let c4 = 0; function f4() { 'use strict'; c4++; } function testRestArgsSpread(...args) { f1(...args); } function testRestArgsApply(...args) { f2.apply(undefined, args); } function testArgumentsSpread(...args) { f3(...arguments); } function testArgumentsApply(...args) { f4.apply(undefined, arguments); }
Tests:
rest args spread
testRestArgsSpread('a', 1, 'b', 2, 'c', 3);
rest args apply
testRestArgsApply('a', 1, 'b', 2, 'c', 3);
arguments spread
testArgumentsSpread('a', 1, 'b', 2, 'c', 3);
arguments apply
testArgumentsApply('a', 1, 'b', 2, 'c', 3);