Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Append with toSpliced vs Spread
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:155.0) Gecko/20100101 Firefox/155.0
Browser:
Firefox 155
Operating system:
Linux
Device Platform:
Desktop
Date tested:
10 days ago
Benchmark engine:
Benchmark.js
toSpliced
20.5M/s
Spread
3.0M/s
View exact numbers
Test name
Executions per second
✓
toSpliced
20,478,854 Ops/sec
Spread
3,009,881 Ops/sec
Script Preparation code:
var array = Array.from({ length: 100 }).map((val, i) => i);
Tests:
toSpliced
var newArray = array.toSpliced(array.length, 0, 99);
Spread
var newArray = [...array, 99]