Files
wordcraft/crates/pdf
Brandon ThomasandClaude Opus 5.5 912d49f38f PDF export: look internal links up in a map, not the whole document (#937)
Found while timing US government documents against Word for Windows.

Before: every internal link (#bookmark: a linked table of contents,
cross-references) found its bookmark by walking every paragraph of the
document, so export time grew with links x length: NIH's 67-page
protocol template (297 links) took 10.6 s to export as PDF.

After: the bookmark positions are gathered once per export (the first
bookmark of a name still wins). The same file exports in 0.9 s with
identical text and links. internal_links_export_in_linear_time guards
it (the old code took 12x as long for 4x the document).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 09:19:41 -04:00
..