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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
toSpliced insert
3493923.5 Ops/sec
splice insert
2824501.5 Ops/sec
with
4102587.5 Ops/sec
toSpliced
4016557.8 Ops/sec
splice
3293323.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)