Skip to content

PERF: Load only the active reader route - #173

Open
anantham wants to merge 7 commits into
fix/codex-public-boundaryfrom
perf/codex-startup-latency
Open

PERF: Load only the active reader route#173
anantham wants to merge 7 commits into
fix/codex-public-boundaryfrom
perf/codex-startup-latency

Conversation

@anantham

@anantham anantham commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

The library and Gita entry routes downloaded the full reader dependency tree before showing their own content. Load the reader and liturgy routes through React lazy/Suspense so each entry fetches only what it needs, retaining the existing chunk-download error UI.

Changes

App.tsx shrinks from 162 to 160 lines. Keep native React loading and error handling; no route loader framework, dependency changes or background automation. The existing startup issue includes a reproducible cold-browser probe and refreshed evidence.

Testing

Node 24.19.0: 25 focused tests, TypeScript, production build and three existing route browser tests pass. Twelve controlled cold Chromium runs (three per route/version, 4× CPU slowdown, 80 ms/10 Mbit network, gzip, external traffic blocked) report no page errors.

Median library readiness: 1,916 → 1,167 ms; JavaScript transferred: 4,765 → 1,867 KB. Median Gita readiness: 1,757 → 610 ms; JavaScript: 4,764 → 197 KB. Synthetic cold-start measurements are not production latency guarantees.

Review

Stacked on #174 to keep already-reviewed configuration changes out of this diff. No merge or deployment. CI and review must cover the current remote head.

Context: Opening any route loaded a 4.76 MB script containing unrelated readers,
benchmark tools, and datasets before the requested page could appear.
Changes: Defer feature modules, unify local packet loading, preserve aliases and
route identity, and report failed downloads without adding retries or dependencies.
Impact: Controlled cold library readiness falls from 1813ms to 1099ms median;
initial decoded JavaScript falls from 4759KB to 1860KB.
Tests: 25 focused Vitest cases; 3 production Chromium cases; typecheck, build,
integrity, and scoped lint/diff checks. Preserve the existing alias-effect warning.
Docs: Add a reproducible local-only probe and measured receipt; update WORKLOG.
ADR: CORE-006 existing lazy-loading intent.
Context: The latency review also exposed redundant subscriptions/discovery,
weak validation coverage, setup friction, and hardcoded provenance copy.
Changes: Add six scoped follow-up tickets to the existing Issues.md with evidence,
acceptance criteria, ownership, risk, and confidence; cross-reference the debt inbox.
Impact: Other agents can pick up bounded deletion-first improvements without
expanding the current route-loading change.
Tests: Documentation links and scoped whitespace checks.
Docs: Issues.md and docs/roadmaps/TECH-DEBT-INBOX.md.
@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:35am UTC

@anantham
anantham changed the base branch from main to fix/codex-public-boundary September 5, 2026 08:13
@anantham
anantham marked this pull request as ready for review September 5, 2026 08:36
@anantham

anantham commented Sep 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review Please review exact current head 7bff3f7 and the focused route-loading diff above #174. Refreshed Node 24.19.0 unit, type, build and production browser checks pass; the PR description contains the updated controlled startup measurements. The latest merge carries the Windows configuration correction and retained documentation only; no route changes since the measured source.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 7bff3f764f

ℹ️ 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".

Retain both issue/debt queues; carry the reviewed route guard and ADR amendment. Startup sources are unchanged. Combined provider/settings/dialog and app-screen tests plus TypeScript pass; fresh CI follows.
@anantham

anantham commented Sep 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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