Repository navigation
Bench opening a diff line's comment box on a page of n asks - #5864
Merged
Merged
Conversation
No benchmark input measured opening a comment box. `comment` opens its box while getting ready and times only the send. On a busy page, opening the box from a diff line's `+` took 100-250 ms (`pr-walkthrough`, 60-150 threads). Most of that is the margin placing every row again once the box grows the diff in the page's flow (#5752). The `open` input clicks the comment control on a line of a one-file patch. It times the click to the first frame that shows the box with the caret in it (`composer` in painted.js). The patch now stands above the sections `ask_sections` writes, whose margin pins grow with n, so opening the box moves every section and pin. On the `threads` page the cost hardly grew (49 to 55 ms of CPU from 64 to 256 threads), because that page puts its threads on 64 sections and so never has more than 64 margin rows. Measured on this Mac under load (load average 10-18), one round: | asks page | 8 | 64 | 128 | 256 | exponent | |---------------------------|----|----|-----|-----|----------| | open cpu ms, Chromium | 36 | 73 | 102 | 175 | 0.96 | | open painted ms, Chromium | 24 | 51 | 80 | 140 | | | open cpu ms, Firefox | 73 | 90 | 176 | 221 | 0.52 | At 256 asks in Chromium, the long frames name the margin's ResizeObserver callback (67 ms), the presentation pass (41 ms) and the diff's click handler (36 ms). The daily run will now read this growth. Every page built on `ask_sections` now holds the patch: `asks`, `asks-marked`, `widgets`, `events` and `revisions`. Their load and input readings rise by the patch's fixed cost from the first run after this lands. A full pass of every input on `asks` still runs, `comment` and `resolve` after `open` included.
leaf-agent
approved these changes
Nov 12, 2026
This was referenced Nov 13, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 13, 2026
…ch uses (#5918) The scheduled `bench` job has failed since #5864 ([run 43204020539](https://github.com/max-sixty/leaf/actions/runs/43204020539)): `leaf-dev bench`'s server read stopped at `server_paths.build` with `AssertionError: <lf-diff> (line 1): unknown widget — not in the page's registry`, after the browser tables but before any server table. #5864 put an `lf-diff` patch above every page built on `ask_sections` (`asks`, `asks-marked`, `widgets`, `events`, `revisions`). The browser bench builds those pages with the example catalog's layer (`page_fixtures.source_packages` falls back to `examples/layer.json`, which selects `diff`), but `server_paths.build` called `cmd_init` with no packages. It now selects that same layer, so both reads measure the same page. Verified on current main: building `asks` at size 8 raises the same assertion before the change. After it, `asks`, `revisions` and `threads` build, and `uv run leaf-dev bench asks widgets --read server --sizes 16,32 --rounds 1` completes with every server path read. Server readings for every collection now include activating and checking against the full example layer, so the first daily run after this may shift their fixed cost. Refs #4225 — automated triage Co-authored-by: leaf-agent <[email protected]>
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.
No benchmark input measured opening a comment box:
commentopens its box while getting ready and times only the send. This addsopen, which clicks the comment control on a line of a one-filelf-diffand times the click to the first frame that shows the box with the caret in it. The patch stands aboveask_sections' sections, whose margin pins grow with n, so the reading grows when the margin places every row again after the box grows the diff in the page's flow (#5752).Where to look: the patch goes on every page built on
ask_sections(asks,asks-marked,widgets,events,revisions), so their readings rise by its fixed cost from the first daily run after this lands. Thethreadspage was the obvious home, but it puts its threads on 64 sections, so it never has more than 64 margin rows and the cost hardly grew there (49 to 55 ms of CPU from 64 to 256 threads).Result on
asksin Chromium, on this Mac under load:opentakes 36 / 73 / 102 / 175 ms of CPU at 8 / 64 / 128 / 256 asks (exponent 0.96), and 24 to 140 ms from the click to the paint. In Firefox it takes 73 to 221 ms of CPU.Max asked for a bench input that would have caught the slow comment box on a busy page; he hasn't read this yet. Checked:
leaf-dev bench askswith every input,--input openat 64 / 128 / 256 in Chromium and Firefox, and pre-commit.