Skip to content

Speed up Reader search, imports, and reading progress - #355

Merged
callumalpass merged 1 commit into
mainfrom
sprint-w7-reader-search-import-perf
Nov 28, 2026
Merged

callumalpass merged 1 commit into
mainfrom
sprint-w7-reader-search-import-perf

Conversation

@callumalpass

@callumalpass callumalpass commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Changes

  • Cache normalized metadata for unchanged source summaries and compute custom sort keys once per matching source.
  • Resolve repeated annotation links once per folder and paged search while preserving passage order and destinations.
  • Hash the supplied byte view directly, cut attribute lookups in imported HTML, and stop scanning EPUB data URLs after the scheme and media type.
  • Calculate chapter progress when a write is due. Leaving flushes the pending locator, and a settled locator produces one write.
  • Restore the first All sources tab's filters from a URL fragment. Correct the filter badge's accessible name and the field-condition button's dark-mode contrast.

Benchmarks

Baseline d739e84f. Vitest uses preselected SDK pages. Chromium uses local import fixtures and the real HTML reading surface with a browser-storage write fixture while offline.

Operation Before After
Metadata queries, 5,000 sources 6.86 ms 4.05 ms
Metadata queries, 10,000 sources 15.29 ms 9.04 ms
Tag/status filter and custom sort, 10,000 sources 0.94 ms 0.38 ms
Mixed note and annotation search, 10,000 sources 6.72 ms 5.76 ms
Annotation link occurrences sent to the SDK, same search 10,000 50
HTML sanitization, 1,200 paragraphs 11.4 ms 7.1 ms
EPUB chapter sanitization, 1,200 paragraphs 47.7 ms 33.3 ms
Plan and hash a 1,000-page PDF 5.4 ms 3.4 ms
Dispatch 1,000 chapter locator updates 624.2 ms 1.3 ms
Writes for a settled burst followed by leaving 2 1

Full tables, fixture sizes, repeat commands and measurement boundaries are in Reader performance.

Verification

  • rpnpm run check passed, including lint, typecheck, workspace tests and i18n.
  • rpnpm run build:production passed and verified 229 offline-shell assets.
  • The 360 px Chromium audit passed for light and dark library, filter menu and HTML article surfaces. It covers axe-core, touch control geometry, reload, Back, and keyboard navigation.
  • Existing large-library keyboard and article highlight restoration and imported SVG Chromium audits passed.
  • Added regressions for link resolution across folders and searches, offset hashing, EPUB URL filtering, and saving the latest pending chapter locator.

@callumalpass
callumalpass merged commit 057ef78 into main Nov 28, 2026
3 checks passed
@callumalpass
callumalpass deleted the sprint-w7-reader-search-import-perf branch November 28, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant