docs(benchmarks): remove em dashes from interning writeup

This commit is contained in:
Mihaela Mihaljevic 2026-08-31 03:53:28 +02:00
parent fb9dab2028
commit b0c64d86b2

View File

@ -151,11 +151,11 @@ patched.
each repeated 100k times), interning gated to fire only above the
small-string threshold. Result (two interleaved A/B pairs each, XSTS clean):
neutral-to-slightly-negative on short names, and **decisively NEGATIVE on
long names, ~4-5% slower, both pairs** — the opposite of the hypothesis.
long names, ~4-5% slower, both pairs**: the opposite of the hypothesis.
The complete mechanism, which the boundary test forced out: a Swift
`String` is reference-counted, so interning does not merely avoid an
allocation, it trades that allocation for **ARC traffic on the shared
instance** — every cache probe copies a `String` out of a slot (a retain),
instance**: every cache probe copies a `String` out of a slot (a retain),
and a hit returns another retain. For the name sizes that occur in XML,
the atomic retain/release traffic to share one heap `String` costs more
than the small `malloc` + memcpy + UTF-8 validation it was meant to