Skip to content

Agent: draw gpui's frame times with MAPLE_FRAME_STATS - #1572

Closed
AnthonyRonning wants to merge 1 commit into
codex-gpuibump-maplefrom
codex-gpuibump-adopt
Closed

AnthonyRonning wants to merge 1 commit into
codex-gpuibump-maplefrom
codex-gpuibump-adopt

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Second PR of the stack, on top of the gpui bump. Having read through what changed upstream, most of the benefit arrives with the bump itself; this is the one change to our own code worth making on master right away. The rest of what the newer gpui enables (springs, one clock for animation tests, real fades over cached views) belongs with the motion work above this.

What it adds

MAPLE_FRAME_STATS=1 makes gpui draw how long each frame took to build and paint in a corner of the main window. MAPLE_FRAME_STATS=full adds percentiles over the last 1000 frames. It works in any build, so it can be read on a packaged build in a VM as well as a local one.

The overlay comes from gpui's profiler feature, which this turns on. Zed ships with it on. gpui paints the overlay straight into the scene, so showing it asks for no extra frames.

docs/performance-check.md gains a step that uses it, so the streaming check can record a number instead of "Smooth".

Why now

The motion work turns single-frame state changes into runs of frames, and each of those frames re-renders the chat view. This gives us a way to see what that costs on each platform before deciding anything by feel alone.

Dependencies

One new registry dependency: hdrhistogram 7.5.4, the version in Zed's lockfile, published well over seven days ago.

Not in this PR

  • The quit prompt's empty-frame workaround. The upstream fix it waits for (gpui_macos: Release the accessibility adapter when a window is dropped zed-industries/zed#64143) is in this gpui, but removing the workaround needs a live retest with an accessibility client attached, which has not been done.
  • The spinner loop. gpui now has capped, phase-locked repeating animations, but our loop also pauses in background windows and throttles under thermal pressure, which gpui's does not, so it stays.

Validation

The repository pre-commit hook passed on this head (fmt, clippy on all four feature sets, the app test suite). The overlay itself has not been looked at in a running app.

🤖 Generated with Claude Code

The newer gpui can paint how long each frame took to build and paint
over the window. Turn its profiler on, as Zed does, and show that overlay
in the main window when MAPLE_FRAME_STATS is set; `full` adds percentiles
over the last 1000 frames. The performance check gains a step that uses
it, so "smooth" can be a number.

One new registry dependency, hdrhistogram 7.5.4, the version in Zed's
lockfile, published well over seven days ago.

Co-Authored-By: Claude <noreply@anthropic.com>
@AnthonyRonning
AnthonyRonning removed this pull request from stack #1574 November 12, 2026 03:37
@AnthonyRonning

Copy link
Copy Markdown
Contributor Author

Folded into #1571, so the gpui bump and the one thing adopted from it (the MAPLE_FRAME_STATS frame counter) are reviewed as one PR. The commit is unchanged (f34a561b) and is now on that branch.

@AnthonyRonning
AnthonyRonning deleted the codex-gpuibump-adopt branch November 14, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant