Public: anyone can read this; the crew can change it.

The pull page answers inside a lower budget, measured #16748

Merged opened this

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

Merged

The pull page now answers in about 8 ms warm instead of about 10.5 ms, and test/pull-budget.test.ts holds it to a 10 ms budget (under half of today's 25 ms). It also asserts exactly 110 SQL statements. The pull-page and page-budget tests I ran pass (49 tests), and tsc and design-lint are clean.

Notes

opened this

The pull page now answers in about 8 ms warm instead of about 10.5 ms, and test/pull-budget.test.ts holds it to a 10 ms budget (under half of today's 25 ms). It also asserts exactly 110 SQL statements. The pull-page and page-budget tests I ran pass (49 tests), and tsc and design-lint are clean.

What changed

  • The conversation page (src/web/studio/change.ts) reads two git results from memory, as the Files step already does. Both use keptRead with the same keys, so the two pages share the entries:
    • the policy wall for the base and head;
    • the commit log for the head.
  • test/pull-budget.test.ts is new. It builds a pull with 20 files, 5 reviews and 3 checks and requests /alice/r/pulls/N signed in. The time assertion reads the app phase of Server-Timing. The statement count is taken with helpers/statements.ts, so a new query fails it.

Numbers on that fixture

BeforeAfter
Fastest warm app phase10.5 msabout 8.3 ms
Median warm app phase13.8 msnot re-measured
Diff stretchabout 2.5 msabout 0.4 ms
SQL statements111110
Budget in src/perf/page_budgets/pull.ts25 ms, 120 statements10 ms, 110 statements

Judging the time

  • The test judges the fastest of 30 warm answers, not the median. The machine was loaded, and the median of 21 runs wandered between 11 and 36 ms. Extra load only slows a sample, while work done on every request, such as a git spawn, shows in every sample.
  • I ran the test 6 times after raising it to 30 runs, and it passed each time. With 15 runs it failed once in 3.
  • A 12 ms bound would not have caught the old code, because its fastest run was 10.5 ms, so I set 10 ms.

Not done

  • src/perf/page_budgets/pull.ts and its 120-statement limit are untouched. That is the other page-budget fixture, a pull with no comments.
  • I did not cut render (about 3.3 ms) or the second checkSummary query further.
  • The pre-push hook required a Try: line in the commit message, so the commit has one.

I used nothing from similar.ts and added no new function; the change reuses keptRead.

[
  {"go": "/alice/r/pulls/1", "look": "The pull page with a large diff, opened twice", "expect": "Same page both times; the second answers faster, with the Server-Timing diff phase under 1 ms", "ask": "Does the Commits fold list the same commits as before?"}
]

Closes #10539

5 earlier comments
commented

The pull page now answers in about 8 ms warm instead of about 10.5 ms, and test/pull-budget.test.ts holds it to a 10 ms budget (under half of today's 25 ms). It also asserts exactly 110 SQL statements. The pull-page and page-budget tests I ran pass (49 tests), and tsc and design-lint are clean.

What changed

  • The conversation page (src/web/studio/change.ts) reads two git results from memory, as the Files step already does. Both use keptRead with the same keys, so the two pages share the entries:
    • the policy wall for the base and head;
    • the commit log for the head.
  • test/pull-budget.test.ts is new. It builds a pull with 20 files, 5 reviews and 3 checks and requests /alice/r/pulls/N signed in. The time assertion reads the app phase of Server-Timing. The statement count is taken with helpers/statements.ts, so a new query fails it.

Numbers on that fixture

BeforeAfter
Fastest warm app phase10.5 msabout 8.3 ms
Median warm app phase13.8 msnot re-measured
Diff stretchabout 2.5 msabout 0.4 ms
SQL statements111110
Budget in src/perf/page_budgets/pull.ts25 ms, 120 statements10 ms, 110 statements

Judging the time

  • The test judges the fastest of 30 warm answers, not the median. The machine was loaded, and the median of 21 runs wandered between 11 and 36 ms. Extra load only slows a sample, while work done on every request, such as a git spawn, shows in every sample.
  • I ran the test 6 times after raising it to 30 runs, and it passed each time. With 15 runs it failed once in 3.
  • A 12 ms bound would not have caught the old code, because its fastest run was 10.5 ms, so I set 10 ms.

Not done

  • src/perf/page_budgets/pull.ts and its 120-statement limit are untouched. That is the other page-budget fixture, a pull with no comments.
  • I did not cut render (about 3.3 ms) or the second checkSummary query further.
  • The pre-push hook required a Try: line in the commit message, so the commit has one.

I used nothing from similar.ts and added no new function; the change reuses keptRead.

[
  {"go": "/alice/r/pulls/1", "look": "The pull page with a large diff, opened twice", "expect": "Same page both times; the second answers faster, with the Server-Timing diff phase under 1 ms", "ask": "Does the Commits fold list the same commits as before?"}
]
commented

<!-- look-pages 0d74fa745a3e --> Look pages for 0d74fa7, from the gate:

  • look pages (none): this pull changes src/web/studio/change.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

The gate couldn't trace a route for this change, so the pull description now names the page it touches.

Looks: /trevato/forge/pulls/16748

This pull changes how src/web/studio/change.ts loads the pull page. It reads the wall and commit log from memory and adds a test, test/pull-budget.test.ts, that holds the page to 10 ms and 110 statements. Nothing about the markup or the page's look changed.

/settings/security/controls is not touched by this pull. The gate's route trace picked it up, apparently from the shared module.

I made no code change this turn, so nothing was run or pushed. The fix is this line in the description.

Review:

[{"go":"/trevato/forge/pulls/16748","look":"the pull page's wall and commit log","expect":"renders as before; only load time changed","ask":"Does the page look identical to main?"}]
commented

The pull page now has one budget, and the earlier description's claim that it had gone to 10 ms / 110 statements is withdrawn. The pull page and roster budget tests pass, as does tsc; the page-budget run was one pass, so the 12.5 ms bound has not been repeated under load.

No look: no markup or style changed; only how long the pull page takes to load. The gate could not trace a page for /settings/security/controls, which this pull does not touch.

  • Shared budget: src/perf/page_budgets/pull.ts is now 12.5 ms / 115 statements, down from 25 ms / 120. 115 is the measured 104 plus a tenth. In the page-budget run the pull page's median was 11.3 ms against that 12.5. An earlier run on a loaded machine measured 14.0 ms, so the bound can still fail under heavy load.
  • Test bound: test/pull-budget.test.ts now reads budget.medianMs instead of keeping its own 10 ms.
  • Flake risk: it judges the fastest of 30 warm requests, so a loaded machine has to be slow on every request to fail it. The floor is 8.3 ms, which leaves 4.2 ms of headroom, up from 1.7 ms.
  • Exact statement count: the test also pins the exact count (110) on its own fixture, a pull with 20 files, 5 reviews and 3 checks. That is a regression pin, not a second budget.
  • Cold open: the wall and commit log are kept per head, so only the second and later requests for a head get faster. The first open of a head is unchanged.
  • Import order: keptRead now sits with its neighbours in src/web/studio/change.ts.

The gate also notes that appPhase in the new test is 0.82 similar to the one in test/feed-budget.test.ts. I left both copies as they are. A shared helper would be a separate change.

Review:

[{"go":"/trevato/forge/pulls/16748","look":"the pull page","expect":"renders as before; only load time changed"}]
commented

<!-- look-pages 109e92643ce7 --> Look pages for 109e926, from the gate:

  • look pages (none): this pull changes src/web/studio/change.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

The gate's look-pages note is the same as before, and it is answered in this description, so I changed no code and pushed nothing.

Looks: /trevato/forge/pulls/16748

The page is the pull page. This pull changes how src/web/studio/change.ts loads it (the head's wall and commit log are read from memory). The markup and styles are the same.

The gate named /settings/security/controls, which this pull does not touch. It could not trace that route's handler and picked the page from the module change.ts is part of.

The rest of the pull stands as described last turn: one shared budget of 12.5 ms / 115 statements in src/perf/page_budgets/pull.ts, read by test/pull-budget.test.ts. A cold first open of a head is unchanged, because the kept reads only help the second request for a head.

Review:

[{"go":"/trevato/forge/pulls/16748","look":"the pull page","expect":"renders as before; only load time changed"}]
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs