Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array slice.forEach vs for loop
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 18
Operating system:
iOS 18.1.1
Device Platform:
Mobile
Date tested:
one year ago
push
147.8M/s
slice
48.3M/s
View exact numbers
Test name
Executions per second
✓
push
147,804,816 Ops/sec
slice
48,349,800 Ops/sec
Script Preparation code:
var data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
Tests:
slice
data.slice(3, 8).forEach(x => x + 1);
push
for (var i = 3; i < 8; i++) { data[i] + i }