Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
toSpliced vs splice vs with
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
toSpliced insert
5483597.5 Ops/sec
splice insert
4278068.0 Ops/sec
with
6245117.5 Ops/sec
toSpliced
6170158.0 Ops/sec
splice
5002325.5 Ops/sec
Script Preparation code:
var arr = [2, 5, 19, 424, 5435, 1231, 123, 453, 5675, 345, 76345, 657, 32432, 45646]; var newArr = null;
Tests:
toSpliced insert
newArr = arr.toSpliced(5, 0, 675);
splice insert
const o = arr.slice(); newArr = o.splice(5, 0, 675)
with
newArr = arr.with(5, 675)
toSpliced
newArr = arr.toSpliced(0, 1);
splice
const o = arr.slice(); newArr = o.splice(0, 1)