From b0c64d86b2afee0f217236622049170394a8cffc Mon Sep 17 00:00:00 2001 From: Mihaela Mihaljevic Date: Mon, 31 Aug 2026 03:53:28 +0200 Subject: [PATCH] docs(benchmarks): remove em dashes from interning writeup --- docs/benchmarks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/benchmarks.md b/docs/benchmarks.md index ed69cc8..ff3832b 100644 --- a/docs/benchmarks.md +++ b/docs/benchmarks.md @@ -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