Skip to content

paginate: mark the boundaries inside avoid boxes once, not per boundary per page - #144

Merged
tannevaled merged 1 commit into
mainfrom
paginate-perf
Sep 7, 2026
Merged

tannevaled merged 1 commit into
mainfrom
paginate-perf

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

allowed scanned every break-inside: avoid group for every candidate boundary on every page. Wikipedia's print stylesheet sets it on table rows, so the countries table paginated in 13.7 s and the Go article in 3.9 s (html2pdf's bench, fragmentation stage). blockedBoundaries now sweeps the groups once (binary search + difference array); a boundary's verdict is a lookup. Same output — Chrome's answer key and every synthetic case pass; 10 000 avoid rows paginate within the test's budget. 100 % covered.

🤖 Generated with Claude Code

…ry per page

allowed scanned every break-inside: avoid group for every candidate
boundary on every page; a print stylesheet that sets break-inside: avoid
on table rows (Wikipedia's does) turns a long table into thousands of
groups, and a page of the countries table took 13.7 s to paginate, the
Go article 3.9 s. blockedBoundaries now sweeps the groups once with a
binary search each and a difference array, so a boundary's verdict is a
lookup. Same breaks (the answer key and every synthetic case pass);
10 000 avoid rows paginate in the test's budget.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 0aee5d6 into main Sep 7, 2026
7 checks passed
@tannevaled
tannevaled deleted the paginate-perf branch September 7, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant