Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Hungry js map vs forEach
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 26_3_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/145.0.7632.108 Mobile/15E148 Safari/604.1
Browser:
Chrome Mobile iOS 145
Operating system:
iOS 26.3.0
Device Platform:
Mobile
Date tested:
5 months ago
forEach
497.3M/s
map
59.2M/s
View exact numbers
Test name
Executions per second
✓
forEach
497,333,984 Ops/sec
map
59,229,580 Ops/sec
Script Preparation code:
// Create sample data var array = []; array.forEach( i => array.push(i) ); var manipulateFn = num => { return num * 2 * 3; }
Tests:
map
var newArray = array.map( i => manipulateFn(i));
forEach
array.forEach( i => { manipulateFn(i); });