gpui: Add per-window frame-duration and present-interval histograms - #61871
Merged
Conversation
Input-latency histograms only sample frames that were preceded by input, so jank during animations and streamed content (agent panel output, terminal scrollback) is invisible in fleet telemetry. Add an opt-in frame-duration-histogram feature that records how long every draw takes and the interval between consecutively presented frames while a window is animating, and report both from Zed as a Frame Duration Report telemetry event alongside the existing latency report.
Both per-window baseline maps grew one entry per window forever; slotmap window ids are never reused, so entries for closed windows were pure leakage. Prune both maps against the open windows on each report.
rtfeldman
marked this pull request as ready for review
August 7, 2026 13:16
Anthony-Eid
approved these changes
Aug 10, 2026
Anthony-Eid
left a comment
Contributor
There was a problem hiding this comment.
approving this because it's needed but I think we should do a fast follow up on combining with the frame profiler bench app context uses as well.
playdohface
pushed a commit
to playdohface/zed
that referenced
this pull request
Aug 29, 2026
…ed-industries#61871) GPUI's input-latency histograms only sample frames that were preceded by input, so a window that janks while animating or while streaming content (agent panel output, terminal scrollback) never shows up in the fleet's latency reports. Hang detection catches outright stalls, but frames that are merely late — stutters in the 30–100ms range during animation — currently aren't visible anywhere. This adds a `frame-duration-histogram` feature to GPUI with a per-window tracker recording two histograms: the duration of every `Window::draw`, and the interval between consecutively presented frames while the window is animating (a next-frame callback was already scheduled at the previous present, so frames are being produced back-to-back and a stretched interval means frames were missed). Intervals are only recorded for active windows, since inactive windows are deliberately throttled to a lower frame rate, and re-presents of unchanged frames (e.g. sustaining the display's refresh rate during high-rate input) are excluded. Zed enables the feature and reports both histograms every five minutes as a "Frame Duration Report" telemetry event alongside the existing "Latency Report", bucketed at roughly the 120Hz/60Hz/30Hz frame budgets so dropped-frame rates can be aggregated across the fleet. Release Notes: - Added frame rendering performance to the diagnostics Zed collects when telemetry is enabled, to help find and fix stutters and dropped frames.
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.
GPUI's input-latency histograms only sample frames that were preceded by input, so a window that janks while animating or while streaming content (agent panel output, terminal scrollback) never shows up in the fleet's latency reports. Hang detection catches outright stalls, but frames that are merely late — stutters in the 30–100ms range during animation — currently aren't visible anywhere.
This adds a
frame-duration-histogramfeature to GPUI with a per-window tracker recording two histograms: the duration of everyWindow::draw, and the interval between consecutively presented frames while the window is animating (a next-frame callback was already scheduled at the previous present, so frames are being produced back-to-back and a stretched interval means frames were missed). Intervals are only recorded for active windows, since inactive windows are deliberately throttled to a lower frame rate, and re-presents of unchanged frames (e.g. sustaining the display's refresh rate during high-rate input) are excluded. Zed enables the feature and reports both histograms every five minutes as a "Frame Duration Report" telemetry event alongside the existing "Latency Report", bucketed at roughly the 120Hz/60Hz/30Hz frame budgets so dropped-frame rates can be aggregated across the fleet.Release Notes: