Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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
Benchmark engine:
Benchmark.js
with
6.2M/s
toSpliced
6.2M/s
toSpliced insert
5.5M/s
splice
5.0M/s
splice insert
4.3M/s
View exact numbers
Test name
Executions per second
✓
with
6,245,118 Ops/sec
toSpliced
6,170,158 Ops/sec
toSpliced insert
5,483,598 Ops/sec
splice
5,002,326 Ops/sec
splice insert
4,278,068 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)