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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

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.

Notes

shipped production is serving it deploy 3fede26

opened this

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;dur from Server-Timing over 9 warm reads, using the repo's median from test/helpers/page_budget.ts. There is no sleep.
    • The median must be under 50 ms.
  • Failure message: it reports the median and the slowest Server-Timing phase by name, for example slowest phase feed 60.2 ms. A second test checks that wording.
  • Docs: docs/web.md had 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-3 app;dur under 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 /feed or 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."}]

Closes #15637

commented

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;dur from Server-Timing over 9 warm reads, using the repo's median from test/helpers/page_budget.ts. There is no sleep.
    • The median must be under 50 ms.
  • Failure message: it reports the median and the slowest Server-Timing phase by name, for example slowest phase feed 60.2 ms. A second test checks that wording.
  • Docs: docs/web.md had 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-3 app;dur under 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 /feed or 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."}]
Approved

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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs