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:
one year ago
Slice
4K/s
Spread
2K/s
Array.from
2K/s
View exact numbers
Test name
Executions per second
✓
Slice
3,899 Ops/sec
Spread
1,811 Ops/sec
Array.from
1,788 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);