Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
multiple shift vs splice
-
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 14; Mobile; rv:120.0) Gecko/120.0 Firefox/120.0
Browser:
Firefox Mobile 120
Operating system:
Android
Device Platform:
Mobile
Date tested:
2 years ago
Test name
Executions per second
splice
21471972.0 Ops/sec
shift
166942624.0 Ops/sec
Script Preparation code:
var arr = []; for (i = 0; i < 1000; i++) { arr.push(i); } var arr2 = []; arr2.push(arr.slice(0, 199)) arr2.push(arr.slice(200, 399)) arr2.push(arr.slice(400, 599)) arr2.push(arr.slice(600, 799)) arr2.push(arr.slice(800, 999))
Tests:
splice
arr.splice(0,200);
shift
arr2.shift();