mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-01 06:16:58 -06:00
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.