# gpui: Record input-to-frame latency histogram \(\#53822\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a9e7b7767207ccf40bcba04a4c5cad96d6916f13)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a9e7b7767207ccf40bcba04a4c5cad96d6916f13

Requested commit: a9e7b7767207ccf40bcba04a4c5cad96d6916f13

Commit: a9e7b7767207ccf40bcba04a4c5cad96d6916f13

Tree: 19e2d9fb0938696e67eab71dbae6521cad09f68b

Author: Eric Holk

Committer: GitHub

## Message

```
gpui: Record input-to-frame latency histogram (#53822)

Adds instrumentation to track input-to-frame latency in GPUI windows,
helping diagnose input responsiveness issues.

## What this does

- Records the time between when an input event is dispatched and when
the resulting frame is presented, capturing worst-case latency when
multiple events are coalesced into a single frame.
- Tracks how many input events get coalesced per rendered frame.
- Both metrics are stored in
[HdrHistogram](https://docs.rs/hdrhistogram) instances with 3
significant digits of precision.
- Latency is only recorded when the input event actually causes a redraw
(i.e. marks the window dirty), so idle mouse moves and other no-op
events don't skew the data.
- Adds a `Dump Input Latency Histogram` command that opens a buffer with
a formatted report including percentile breakdowns and visual
distribution bars.

## Example output

The report shows percentile latencies, a bucketed distribution with bar
charts, and a per-frame event coalescing breakdown.

Release Notes:

- N/A

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Cole Miller <cole@zed.dev>
```

## Parents

- [7306ffc12cee32239ae6e7bb484b36e7a6fca739](https://git.cafe/gitcafe/zed/commit/7306ffc12cee32239ae6e7bb484b36e7a6fca739?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a9e7b7767207ccf40bcba04a4c5cad96d6916f13?format=markdown)
