Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
for vs reduce for object
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Browser:
Chrome 121
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
reduce
16359835.0 Ops/sec
for
2031256.5 Ops/sec
Script Preparation code:
var gsmCells = [ { "countrycode": 250, "operatorid": 2, "lac": 9703, "cellid": 23446, "signal_strength": -75 }, { "countrycode": 250, "operatorid": 2, "lac": 9703, "cellid": 59141, "signal_strength": -76 }, { "countrycode": 250, "operatorid": 2, "lac": 9703, "cellid": 6924, "signal_strength": -80 }, { "countrycode": 250, "operatorid": 2, "lac": 9703, "cellid": 23449, "signal_strength": -81 } ];
Tests:
reduce
gsmCells.reduce((prev, curr) => prev.signal_strength > curr.signal_strength ? prev : curr );
for
let max = gsmCells[0]; for(let i = 0; i < gsmCells.length; i++){ if(gsmCells[i].signal_strength > max.signal_strength) max = gsmCells[i]; }