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 (X11; Ubuntu; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0
Browser:
Firefox 129
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
for
196K/s
reduce
112K/s
for of
105K/s
map
59K/s
View exact numbers
Test name
Executions per second
✓
for
195,508 Ops/sec
reduce
112,317 Ops/sec
for of
104,803 Ops/sec
map
59,442 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; }