Skip to content

perf(reader): remove unused app-shell subscriptions - #175

Open
anantham wants to merge 3 commits into
perf/codex-startup-latencyfrom
perf/codex-reader-latency
Open

perf(reader): remove unused app-shell subscriptions#175
anantham wants to merge 3 commits into
perf/codex-startup-latencyfrom
perf/codex-reader-latency

Conversation

@anantham

@anantham anantham commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

Unrelated store updates caused the reader shell to run chapter lookups for values it never rendered. Remove nine unused selectors, unused settings calculations and a production fallback used only by an incomplete test fixture.

Changes

  • components/MainApp.tsx: 282 → 199 lines; two any types removed. Keep the existing job-resumption and tab-close protection.
  • Add a reproducible browser probe with synthetic chapters and record the results in the existing latency ticket.

Testing

Node 24.19.0: 46 focused tests, TypeScript, lint (zero errors; existing warnings) and production build pass. Six isolated Chromium contexts under 4× CPU slowdown pass navigation, translation switching and tab-close protection. For 1,000 unrelated updates, chapter lookups fall from 2,000 to zero in every run. One synthetic sample measured chapter navigation median 252 → 222 ms; that timing is noisy and is not a production guarantee.

MainApp chunk: 522,418 → 521,479 bytes. MainApp function complexity stays 10. Focused coverage falls from 75.26% to 68.57% lines as covered dead code is removed; assertions and thresholds are unchanged.

Review

Stacked on #173 for a focused diff. No dependency changes or deployment. Full-book and physical-device latency remain unverified.

Remove nine unused store subscriptions, obsolete scaffolding and the production no-op created for an incomplete test fixture. Preserve initialization, preload and job warnings.

Verification: 46 focused tests, production browser chapter/version switching and warning checks, TypeScript and build. Unrelated updates now trigger zero chapter lookups instead of two each; small synthetic timing differences are not production-device claims.

Docs: LAT-02 receipt records reproduction, line/complexity/coverage/bundle metrics and limits.
@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lexicon-forge Ready Ready Preview Sep 5, 2026 10:38am UTC

@anantham

anantham commented Sep 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review Please review the current head and focused diff against #173. Node 24.19.0 focused tests (46), types, build and six isolated production browser contexts pass. The probe measures 2,000 to zero chapter lookups during 1,000 unrelated updates; existing background-job and tab-close behavior is verified. No deployment.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: e1e5bbd977

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Preserve both worklog receipts. Reader implementation is unchanged; eight combined app-screen/dialog tests and TypeScript pass. Fresh CI and exact-head review follow.
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