Repository navigation
Performance round 4: engines and engine code only where needed, headings at once - #326
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… on drills and puzzles The broadcast list started Stockfish and Maia (Stockfish's 76 MB of nets on a first visit) because any path containing /broadcast matched; a round now starts them when it opens. /drills and /puzzles need Stockfish only after a while (a drill is picked first; a puzzle is analysed in the background), so there it starts once the page has loaded and the browser is idle, instead of competing with the page's own requests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_app imported the Stockfish and Maia providers (and so both engines' code and Maia's move tables) and the analysis list provider, so every page downloaded and ran them. Engine pages now list the providers they need (Page.providers, see src/contexts/pageProviders), and _app adds them. First Load JS shared by all pages 308 -> 235 kB (_app 141 -> 67 kB); home 295 -> 235, /leaderboard 296 -> 223, /blog 284 -> 210 kB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… at once Both pages rendered nothing (on the server too) until their data arrived, then faded in from transparent, so their headings showed only after the request. The leaderboard now renders its heading, columns and note at once, with placeholder rows until the rankings arrive; the broadcast list renders its heading and a short note while Lichess answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ssion The list asks only Lichess, but sat in AuthenticatedWrapper, which renders nothing until the account request returns (and nothing on the server). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hero's three counters sprang from 0 to tens of millions, which took about 3 s to settle and re-laid out their text on every frame of it (the duration prop was ignored by the spring). They now tween in 1.5 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…usel measured Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ashtonanderson
force-pushed
the
claude/perf-round-4
branch
from
November 3, 2026 06:22
4fe9b5b to
eff77bb
Compare
ashtonanderson
marked this pull request as ready for review
November 3, 2026 06:34
This branch was successfully deployed
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.
Fourth round, after #324: the page-loading costs Lighthouse found on maiachess.com (phone scores 41–70). Details and all numbers in
LOADING.md("Round 4").Changes
_app.tsxmatched any path containing/broadcast, so a first visit downloaded Stockfish's 76 MB of nets just to show a list. It now starts no engine; a round starts them when it opens.deferStart)._app.tsximported the Stockfish, Maia and analysis-list providers, so every page downloaded and ran both engines' code and Maia's move tables (111 KB, parsed on every load). Engine pages now list the providers they need (Page.providers,src/contexts/pageProviders.ts). First Load JS shared by all pages 308 → 235 kB.Results (
main→ branch)Emulated phone (4G, every thread at a quarter speed), medians of 5 loads:
Home on a desktop: main-thread work over the load and 6 s 2.65 → 2.04 s (counters at 1.5 s).
The home page's other costs, measured by leaving each out (phone, main-thread work): without the Play section's 36-board grid 6.8 → 5.8 s on a first visit, 5.1 → 4.3 s returning (desktop 1.29 → 0.94 s); without the game carousel, no measurable change. Neither is removed here.
Lighthouse, phone settings, local builds, medians of 3:
Stockfish
Not slower (
scripts/perf/chart-probe.mjs, 8 moves per run, analysis page):main→ branchTesting
npm test(84, with main's),npx tsc --noEmitandnpm run lintpass, rebased on main after Capture PostHog web vitals again #330 and Track what visitors do, and stop losing events #332.main.Not done
Shells for the app pages. /puzzles, /drills, Bot or Not and analysis still send only the header and footer. They wait for the visitor's session and their data, and choose the phone or desktop layout in JavaScript after loading. A server-rendered shell would show the desktop layout on a phone and then jump, so it first needs that switch moved to CSS.
🤖 Generated with Claude Code