Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
test push + concat in loop versus push a collection + concat with map
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:150.0) Gecko/20100101 Firefox/150.0
Browser:
Firefox 150
Operating system:
Linux
Device Platform:
Desktop
Date tested:
4 months ago
Benchmark engine:
Benchmark.js
multiple push + concat in a loop
5.4M/s
push destructured array + map concat in one call
4.3M/s
View exact numbers
Test name
Executions per second
✓
multiple push + concat in a loop
5,419,849 Ops/sec
push destructured array + map concat in one call
4,321,263 Ops/sec
Tests:
multiple push + concat in a loop
const result = []; const entries = ["a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a"]; entries.forEach(entry => result.push(entry + "c"));
push destructured array + map concat in one call
const result = []; const entries = ["a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a"]; result.push(...entries.map(e => e + "c"));