Repository navigation
chore(desktop): measure the startup bench from the screen - #49894
Merged
Merged
Conversation
Renderer paint timing does not say when the user sees the interface: Chromium stops painting a window it considers occluded, and a splash or a fade reads as painted long before the shell is on screen. The harness now pins the window topmost without activating it the moment it exists, samples its pixels, and reports when they first differ from the background (screenPainted) and when they stop changing (screenSettled). --window-at restores the window on a display the developer's foreground window does not cover, DOM probes are scoped to #root so a static snapshot cannot count as the shell, BENCH_SCREEN_DUMP saves the samples and BENCH_EXTRA_ARGS passes Chromium switches.
This was referenced Sep 19, 2026
jinhuang712
pushed a commit
to jinhuang712/opencode
that referenced
this pull request
Sep 26, 2026
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.
The startup bench reported
shellVisiblefrom the DOM andfirstPaintfrom the renderer's paint timing. Neither is what the user sees:firstPaintshellVisible(DOM)screenSettled(new)pwshhelper is started before the app; it pins the app's main window topmost without activating it (SetWindowPosHWND_TOPMOST,SWP_NOACTIVATE) the moment the handle exists, then samples a 16×16 pixel grid of the window every ~30 ms for 3 s.screenPainted: first sample that differs from the background colour.screenSettled: first sample after which the content no longer changes.--window-at x,yrewrites the profile's window-state so the bench window restores on a display the developer's window does not cover (displayBoundsresolved from the screens).#rootso a static pre-rendered snapshot cannot count as the shell;document.visibilityStateis recorded asdocumentVisible.BENCH_SCREEN_DUMP=<dir>saves every sample as PNG (the filmstrip above),BENCH_EXTRA_ARGSpasses extra Chromium switches to the app.Also surfaced by this: the GPU shader disk cache never persists in this app's profile (
GPUCache/indexhas 0 entries after 40 s runs and graceful exits), so every launch recompiles ~30 shader programs for the shell on the GPU main thread (~15 ms each, serialised) before the first frame of the interface can be presented. Separate issue.