You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(no-reference-style): gate footnote regex scans behind a byte needle
checkFootnotes ran footnoteRefRE and footnoteDefRE over the full source
on every Check call, even on files with no footnote syntax at all. Per
docs/development/high-performance-go.md ("Gate expensive analyzers
behind a cheap pre-check... byte-needles gate regex paths"), add a
bytes.Contains(f.Source, "[^") pre-check mirroring MDS012's
mayContainURL: every match either regex could produce requires that
literal byte pair. Measured on a 200-paragraph footnote-free fixture:
~253,800 ns/op -> ~4,500 ns/op (~56x), 0 allocs/op either way.
BenchmarkCheckFootnotes_NoFootnotes pins the regression with a hard
ns/op budget (b.Fatalf on overshoot), confirmed red against the
pre-fix code and green after.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016wWQmrtb8EMbn1hDgkESqE
0 commit comments