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 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0
Browser:
Firefox 148
Operating system:
Windows
Device Platform:
Desktop
Date tested:
6 months ago
Benchmark engine:
Benchmark.js
for
58K/s
for of
56K/s
reduce
54K/s
map
33K/s
View exact numbers
Test name
Executions per second
✓
for
58,393 Ops/sec
for of
56,410 Ops/sec
reduce
54,461 Ops/sec
map
33,466 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; }