refactor: a field round reads the page grid once

Both indexes and the cross-references each read it for themselves, twice per round in
the index's case: 59 readings of it over a load where 37 do. The round hands one to
every reader instead, so they all resolve their pages against the same grid, and the
lazy holders they kept go with it. No measurable time — the style pass a reading forces
is owed to the geometry read that follows it either way.
This commit is contained in:
Steffen Becker committed 2026-09-09 09:01:29 +02:00
1 parent fed2ccedad
commit 2f51292587
4 files changed
+17 -19

No files matched your search

+2 -1
View File
@@ -149,7 +149,8 @@ Opening a 460-page document ran five rounds of that where four answer everything
**The fields of one answer read together.** Every field that resolves against the settled
layout — each index's page numbers, every cross-reference — registers with
`scheduleFieldRound(view, owner, read)` (`pageBreaks.ts`) instead of scheduling a frame of
its own. The round runs every reader's measurement first and only then their writes, since
its own. The round reads the page grid once and hands it to every reader — they all resolve
against the same one — and runs every reader's measurement first and only then their writes, since
a write between two measurements makes the browser lay the whole document out again; a
write may return one more phase (the index reads back where its rows now fall), run after
every other write. Their cached results — the index `entries`, a reference's `text` — ride