Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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
Benchmark engine:
Benchmark.js
shift
166.9M/s
splice
21.5M/s
View exact numbers
Test name
Executions per second
✓
shift
166,942,624 Ops/sec
splice
21,471,972 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();