Public: anyone can read this; the crew can change it.
The signed-in home's first paint answers in under 50 ms with 500 feed items, proven by a test of the server-timing numbers #15647
Check · Review · Land · Live done — Landed and live in production.
A new test, test/home-first-paint.test.ts, now checks the signed-in home's first paint with 500 feed items, and it passes. The only other check I ran was bun x tsc --noEmit, which was clean. scripts/gate.ts --fix printed nothing, so I couldn't tell whether it passed.
shipped production is serving it deploy 3fede26
A new test, test/home-first-paint.test.ts, now checks the signed-in home's first paint with 500 feed items, and it passes. The only other check I ran was bun x tsc --noEmit, which was clean. scripts/gate.ts --fix printed nothing, so I couldn't tell whether it passed. I didn't run scripts/fast.ts or any other test file.
- What it does:
- It seeds 500 events (the feed's items) and does one cold read of
/as a signed-in member. - It then takes the median
app;durfromServer-Timingover 9 warm reads, using the repo'smedianfromtest/helpers/page_budget.ts. There is no sleep. - The median must be under 50 ms.
- It seeds 500 events (the feed's items) and does one cold read of
- Failure message: it reports the median and the slowest
Server-Timingphase by name, for exampleslowest phase feed 60.2 ms. A second test checks that wording. - Docs:
docs/web.mdhad no 50 ms row, so I added a "Home's first paint" section saying the median of 9 warm reads must stay under 50 ms with 500 items. - No fix needed: the home is already under budget, so no index or code change was needed. The test runs in about 3 seconds.
- Existing coverage:
test/home-feed-budget.test.ts(#13595) already checks query plans and a best-of-3app;durunder 50 ms at 5,000 events. I left it alone. The new test adds the 500-item case, the median of 9 and the named phase. - Left out: I didn't add a page-budget roster entry, and the test doesn't cover
/feedor the API.
[{"go":"/","look":"Run `bun test test/home-first-paint.test.ts`.","expect":"Two tests pass. Lowering FIRST_PAINT_MS to 0 makes the first fail and name the slowest phase."}]Clean, test-only change. It seeds 500 events and reads / as a member. It takes the median app;dur of 9 warm reads against 50 ms, and the failure text names the slowest phase. The preview home emits real phases (session, key, shelf, tiles, render), so the naming works against live output. Nits, not blocking: phases and verdict are exported from a test file with no importer, and the 50 ms is a constant in the test rather than read from docs/web.md.
A new test,
test/home-first-paint.test.ts, now checks the signed-in home's first paint with 500 feed items, and it passes. The only other check I ran wasbun x tsc --noEmit, which was clean.scripts/gate.ts --fixprinted nothing, so I couldn't tell whether it passed. I didn't runscripts/fast.tsor any other test file./as a signed-in member.app;durfromServer-Timingover 9 warm reads, using the repo'smedianfromtest/helpers/page_budget.ts. There is no sleep.Server-Timingphase by name, for exampleslowest phase feed 60.2 ms. A second test checks that wording.docs/web.mdhad no 50 ms row, so I added a "Home's first paint" section saying the median of 9 warm reads must stay under 50 ms with 500 items.test/home-feed-budget.test.ts(#13595) already checks query plans and a best-of-3app;durunder 50 ms at 5,000 events. I left it alone. The new test adds the 500-item case, the median of 9 and the named phase./feedor the API.Closes #15637