Repository navigation
docs: propose how a pdf page loads at level 3 - #1256
Merged
Merged
Conversation
Measured on `Core_v5.1.pdf` (2985 pages): - Core renders the whole document in 4.9 s with 761 MB, and one page in 5 to 37 ms. - The browser parses the 127 MB page in 1.8 s. So for a server, the time is in core. Decision 7 weighs two options: - A: keep the full pass and load the bodies of the later pages. - B: render each page alone. Class names come from a hash, and fonts are shared files with a cmap that is the same for every page. The recommendation is B. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017QtawyvLP2SCnoBtnVfFed
The proposal said that the writer re-encodes each font with the code points of the runs it meets. Only `single_layer` does that. In `dual_layer`, the default, `reencode_to_pua` maps every glyph to a private-use code point, so a font file does not change from page to page. Also use `c`, a prefix the writer has, in the class examples. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHNzLmVv1mFWfPitHASucN
andiwand
force-pushed
the
docs/pdf-level-3
branch
from
October 24, 2026 21:59
a7ee736 to
c9451bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Generated with Claude Code
Refs #764.
Summary
This adds decision 7 to
docs/design/lazy-loading.md, a proposal for level 3 of a pdf.Measured on
Core_v5.1.pdf(2,985 pages):document.htmlFor a server, the time is in core. For an offline file, core works once and the reader waits for the browser.
dual_layer, the default, a font is already the same for every page. Onlysingle_layermust re-encode a font from its wholeToUnicodemap.The doc recommends B, because the time is in core. A is the smaller step. The browser cost is the same for both.
Review fixes
single_layerdoes that. Indual_layer, the default,reencode_to_puamaps every glyph to a private-use code point, so a font file is already the same for every page. Option B is a little smaller for the default mode.x, which the writer does not have. They now usec.