`+=` is 3.6× faster than `push + join` for string building
When you join 10,000 short strings, building with += beats collecting into an array and joining. V8's cons strings make repeated concatenation cheap.
Result
| Run | push + join | `+=` concatenation | Ratio |
|---|---|---|---|
| Run 1 | 0.300 | 0.084 | 3.57× |
| Run 2 | 0.323 | 0.090 | 3.58× |
| Run 3 | 0.308 | 0.087 | 3.55× |
Conditions
Joining 10,000 segments ('segment-0' … 'segment-9999') into one string.
Where this number does not apply
The gap shrinks for multi-megabyte strings or when you concatenate only a few times. Other browsers may behave differently.
Reproduce
cd bench
node --expose-gc micro-fixed.mjs --out ../data/run.json --samples 21 Run it three times on the same machine; if the spread of median stays under 10%, you should land on the same conclusion. If your numbers disagree, tell us and we will retract.