Frontend perf + correctness: capture plan in tasks/#645
Merged
ajslater merged 1 commit intov1.11-performancefrom Apr 30, 2026
Merged
Frontend perf + correctness: capture plan in tasks/#645ajslater merged 1 commit intov1.11-performancefrom
ajslater merged 1 commit intov1.11-performancefrom
Conversation
Survey + plan covering ~12k LOC of components and ~3.5k LOC of
stores/api/plugins. The investigation itself fanned across four
parallel sub-agents (browser, reader, API+socket, admin+metadata)
plus build-config review; ~64 raw findings synthesized into four
tiers and five sub-plans.
Tier 1: 13 correctness bugs — race conditions, leaks, broken-
since-conception features. Examples: page.vue's load-progress
spinner uses setTimeout(function() ...) so this is wrong and the
spinner never actually appears; reader.js's no-arcs mtime
fallback uses { r: "0" } when adjacent code uses { group, pks }
so the fallback is a 500; loadBrowserPage and loadBooks have no
AbortController so rapid clicks race. Ships first.
Tier 2: 19 hot-path render allocations. Per-render array
spreads, deep watchers, structuredClone-of-frozen-sentinels,
metadata layout thrash, theme lookups per chip. Each item small;
aggregate dominates render frames on large libraries.
Tier 3: 11 network/dedup. AbortController plumbing, pending-
promise dedup, exponential backoff on WS reconnect, CSRF token
cache, admin static-table caching.
Tier 4: 7 reader-specific. Bound the prefetch window (currently
all pages prefetched on a 1000-page omnibus), throttle the
vertical-scroll handler, debounce bookmark API calls, tighten
the eager window in horizontal mode, replace fixed-timeout
programmatic-scroll guard with onscrollend.
Sub-plans:
- 01 correctness-bugs: ship first; ~150 LOC across 13 files
- 02 request-dedup: AbortController + dedup helpers; ~200 LOC
- 03 hot-path-renders: split into two PRs (browser + metadata)
- 04 reader-scroll-perf: prefetch window + scroll throttle
- 05 bundle-and-startup: vendor chunk split + parallel cold-boot
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Plan-only PR covering the codex frontend (~12k LOC components + ~3.5k LOC stores/api/plugins, 170 .js/.vue files). Mirrors the importer-perf / janitor-perf plan-capture pattern (#621, #625, #627, #635).
Investigation methodology
Surface too big for a single sweep. Fanned the investigation across four parallel sub-agents — browser, reader, API+socket, admin+metadata — plus build-config review by hand. ~64 raw findings synthesized, deduplicated, and grouped into four tiers and five sub-plans.
Headline findings (correctness)
Two confirmed silent-failure bugs on the read path:
components/reader/pager/page/page.vue:104The load-progress spinner literally never shows. Has been broken since the file was written.
stores/reader.js:486The fallback the comment says was added to avoid a 500 itself returns a 500.
Plus 11 more bugs of varying severity: rapid-click races on
loadBrowserPage/loadBooks, iOS PWA blob URL leak, unbounded search history growth, double-rendering of filter list items, etc.Plan structure
Suggested ship order: 01 → 02 → 03 → 04 → 05. Correctness first, then network dedup, then per-render optimizations, then reader-specific, then build/startup.
Test plan
00-meta.mdfor surface-map accuracy and finding triage🤖 Generated with Claude Code