Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array slice vs for loop
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 136
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
slice
13.0M/s
push
7.3M/s
View exact numbers
Test name
Executions per second
✓
slice
12,972,763 Ops/sec
push
7,326,258 Ops/sec
Script Preparation code:
var data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
Tests:
slice
var copy = data.slice(3, 8);
push
var copy = []; for (var i = 3; i < 8; i++) { copy.push(data[i]) }