Files
wordcraft/crates
Moriarty Puth 9740e73bd2 Layout: a document of many pages paid a body-length scan per page
The wrap areas of footers and the table areas of headers are looked up
per page, and on a cache miss the code asked Document::sections() for
the section properties — a walk of the whole body. A document whose
every paragraph starts a page (200 k one-line paragraphs, 2 MB) took
68 s to lay out, 84 % of it in those walks: the cost grew with pages x
paragraphs. Carry the section list on the Ctx instead — one walk per
pass — and let both sites read it there; the document does not change
during a pass, so the list is the same.
2026-10-24 11:41:58 +07:00
..
2026-10-23 23:03:23 +01:00