Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Reduce vs map/join
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 16; Mobile; rv:153.0) Gecko/153.0 Firefox/153.0
Browser:
Firefox Mobile 153
Operating system:
Android
Device Platform:
Mobile
Date tested:
one month ago
Benchmark engine:
Benchmark.js
for
68K/s
reduce
33K/s
for of
32K/s
map
18K/s
View exact numbers
Test name
Executions per second
✓
for
67,824 Ops/sec
reduce
33,234 Ops/sec
for of
32,418 Ops/sec
map
18,099 Ops/sec
Script Preparation code:
var strings = []; for (var i=0; i<1000; i++) { strings[i] = ""+i+i; }
Tests:
for
var result = ""; for (var i=0; i<strings.length; i++) { result = result+' x-'+strings[i]; }
reduce
var result = strings.reduce(function(string, i) { return string+' x-'+i; }, ""); result=result.substring(1);
map
var result = strings.map(function(i) { return 'x-'+i; }).join(' ');
for of
var result = ""; for (var i of strings) { result += ' x-'+i; }