Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Add a lot of elements to array: slice and push vs destructuring
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:144.0) Gecko/20100101 Firefox/144.0
Browser:
Firefox 144
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
6 months ago
Test name
Executions per second
spread operator
296.5 Ops/sec
Push
564.0 Ops/sec
Tests:
spread operator
const before = Array(100000).fill('before') const after = Array(100000).fill('after') const other = [ ...before, ...after ]
Push
const before = Array(100000).fill('before') const after = Array(100000).fill('after') const other = before.slice().push(...after)