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
{{ message }}
Repository navigation
Commit 102ad33
Browse filesBrowse the repository at this point in the historyBrowse files
* perf(css,html): reduce syntax parser overhead
* refactor(css): preserve spec token operations
* perf(html): avoid redundant syntax parser scans
* fix(html): handle NUL characters in CDATA sections
* perf(html): keep the clamped column capacity, memoize the CDATA bracket scan
`_growNodeColumns` clamps an incremental doubling to exactly
`_COLUMN_SHRINK_CAPACITY` so the columns stay in the kept regime, but the
release comparisons had been tightened to include that capacity, freeing the
very value the clamp aims at. A document whose node count lands between its
`len/12` pre-size and the threshold then re-allocated every column on each
parse: the `html-printer-document-unit` document fixture allocated 5.41 MiB of
typed arrays per parse under `beautify` and `minify`, against none on `main`.
The CDATA fast-forward's `]` scan is memoized like the NUL one beside it. NULs
separated by ordinary characters re-entered the "anything else" branch and
rescanned the rest of the section each time: 4000 NULs over a 404 KB section
scanned 808,194,000 characters, now 403,998.
Trim the branch's comment back under the three-line limit.
* test(html): benchmark a sparse inline-style document
The printer fixtures all run about 12 bytes per `<`, so their columns are
sized from markup either way and the sparse pre-size path is never exercised.
A 2 MiB critical-CSS `<style>` behind eleven delimiters is the shape the
markup probe exists for: 40.39 -> 3.38 ms and 7.667 -> 0 MiB per call under
`beautify`.
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
0 commit comments