Port Bun’s heap-backed LabelFrame state machine into Home. Home currently recurses through processInlineContent for every link/image/wiki label, rebuilding emphasis state and eventually overflowing the native stack or taking quadratic time on deeply nested image chains. Replace recursion with recycled explicit frames, move resolved-delimiter ownership between frames, share the root bracket map and HTML memo, preserve exact span nesting/alt-text behavior, and support arbitrary depth without truncation or caps. Parent tracker: #66; builds on #743 and #744.
perf(markdown): render nested labels with iterative frames
#745Implemented and pushed to origin/main in 89d170e (perf(markdown): render nested labels iteratively (#745)). Home now uses a reusable heap-backed LabelFrame stack, moves resolved-emphasis ownership between frames, shares the root bracket map and HTML-scan memo across label sub-slices, and unwinds link/image/wiki spans without recursive processInlineContent calls or a depth cap. Verification: all three changed files pass zig ast-check and zig fmt --check; git diff --check passes. A Markdown-only semantic harness compiled and passed 18/18 tests at 186 MB peak, including exact output for nested link/image/emphasis/escape transitions and 20,000 nested image labels flattening to one image without stack recursion. The full home_rt compile was safely stopped by the fixed guard at 4,128 MB versus the 3,840 MB ceiling (exit 125, host 37%); the cap was not raised and the build was not retried.
Sign in to comment on this issue.