Files
hyperframes/packages
Michael WangandClaude Opus 5.5 12832e3a98 perf(lint): rules scan script, style and comment blocks in linear time (#7770)
* perf(lint): rules scan script, style and comment blocks in linear time

Several always-on rules matched open/any/close regexes over the whole
document, which rescan to the end from every unclosed opener, so lint
time grew with the square of the page on pages of unclosed <script,
<style, <pre or /* openers. Those scans are now forward passes in
lint/src/linearScans.ts that return exactly what the regexes did:
block-comment stripping, the malformed </script check, the style-tag
balance count, the visible-comment rule's protected blocks and tag
tracking, the structural line count, the script-src check, and the
slideshow island lookup.

A fuzz test compares each scan with its regex on 20,000 generated pages,
and 4 MB pages of unclosed openers finish in milliseconds. On a 140 KB
page of unclosed <script> openers lintHyperframeHtml drops from about
2.6 s to 45 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(lint): compare each fuzz page in one assertion so the run fits the default timeout

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(player): raise the packed size budget for the bundled slideshow island scan

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 23:43:21 +00:00
..
2026-11-14 18:15:46 -05:00
2026-11-14 18:15:46 -05:00
2026-11-14 18:15:46 -05:00
2026-11-14 18:15:46 -05:00
2026-11-14 18:15:46 -05:00
2026-11-14 18:15:46 -05:00
2026-11-14 18:15:46 -05:00