XPerf
LanguagesJavaScriptEvidence_removed

jp-string-plus-in-loop — removed 2026-10-23 (Asia/Shanghai)

Status: removed. The matcher saw += of a string literal or String.fromCharCode and told you to switch to push then join. That rewrite does not have about a 2× gain on those shapes. The matcher is deleted. The slug is never reused.

How measured

examples/bench/evidence_jp005_jp006.js. Nine rounds after three warm-up runs; median. Both sides build the same string and read its length. Node v24.18.0, V8 13.6.233.17-node.50. JSONL: jp-string-plus-in-loop.jsonl.

ratio is += time / join time. About 2 would mean join is twice as fast. Under 1 means join is slower.

rolecasemedian_msopsratio
befores += "\n", 100 chars × 2000.194200001.534
afterpush + join0.126200001
befores += "\n", 22000 chars × 201.6484400000.598
afterpush + join2.7564400001
befores += "\n", 44000 chars × 101.4594400000.459
afterpush + join3.1764400001
beforeString.fromCharCode, 22000 × 100.8932200000.337
afterpush + join2.6472200001
beforeString.fromCharCode, 44000 × 50.6882200000.197
afterpush + join3.4942200001
before64-char literal × 700 × 400.070280000.310
afterpush + join0.226280001
beforeobj.s += "\n", 22000 × 100.7592200000.418
afterpush + join1.8162200001
befores += ch (the matcher did not see this)1.1784400000.417
afterpush + join2.8234400001

The only case where join was faster is 100 newlines, at 1.53×, under the gate. At 22000 and 44000 characters, join is slower. V8 already builds the string for += in a loop. push then join also allocates the pointer array.

Fixtures

Historical bad/good fixtures live under _removed/fixtures/. They are not part of the smoke run.