Repository navigation
Speed up large Reader libraries and long-article highlight painting - #360
Merged
Merged
Conversation
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.
Reader now builds the source command list when the palette opens, sorts an unfiltered title snapshot directly and compares each distinct tag once per filter. Paged annotation search validates a resolved owner ID once per record path. Drawing a highlight can use the first match of the full normalized quote and its surrounding context. Strict search still checks ambiguity, and partially matching or edited quotes still use the scored matcher.
Chromium measurements
Compared with
cb7ff1e5fcbcdfa1b29fe7d2d2c442bdf946a5a9on the same workstation. One warm-up pair and nine measured pairs per size, with the order reversed each pair. Chromium 156.0.8078.4. Times are milliseconds. p95 is the nearest-rank p95 across nine observations (the maximum). The startup fixture mounts the virtualized Reader workspace in a 1280 × 900 viewport. The response-to-grid row starts after the synthetic library HTTP response finishes. The other rows run in a separate Chromium page. Local operation batches average 100 calls for the 100-source control and eight for the large library. Each article sample uses a fresh runtime.10,000 sources
100 sources
The large-library medians improved for startup, title sort, metadata/tag filtering, tag ranking and grouped search. Unique and repeated highlight painting also improved at p95. Startup, filtering, tags and search had higher large-library p95s in this run. The unchanged sanitizer/layout control was slower at both percentiles. The shared machine had load averages above 40 on 16 logical CPUs during the run, so these observations do not establish a tail-latency improvement across the library.
Search measures grouping and passage extraction from preselected SDK pages containing one source note and ten annotations per owner. It excludes authority query execution and network latency. Tag suggestions use Reader’s existing 2,000-source sampling limit. The long article has 3,000 paragraphs. The fixture checks all 600 highlight positions in each distribution and confirms that inline handlers are removed and the last paragraph lays out.
Reproduce
From this PR's checkout, install both revisions and copy the identical browser fixture into a temporary baseline tree.
Offline investigation
The production report observed locally readable annotations and an article retry screen after an offline reload. It did not capture the retry text or failed operation. Source inspection shows Reader resolves current file metadata and streams the attachment through the SDK. Reload discards its in-memory object URL. Durable attachment availability remains an SDK question under the storage policy documented in
docs/offline-shell.md. This performance PR makes no production offline-reopen claim.