Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array clone (spread vs slice vs array.from)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Browser:
Firefox 140
Operating system:
Linux
Device Platform:
Desktop
Date tested:
9 months ago
Test name
Executions per second
Spread
1811.1 Ops/sec
Slice
3899.5 Ops/sec
Array.from
1788.3 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const array = Array.from({ length: 128000 }, (_, i) => { return { i } })
Tests:
Spread
const copy = [...array];
Slice
const copy = array.slice();
Array.from
const copy = Array.from(array);