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>
18 lines
337 B
TOML
18 lines
337 B
TOML
[package]
|
|
name = "input_latency_ui"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
publish.workspace = true
|
|
license = "GPL-3.0-or-later"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
path = "src/input_latency_ui.rs"
|
|
|
|
[dependencies]
|
|
chrono.workspace = true
|
|
gpui = { workspace = true, features = ["input-latency-histogram"] }
|
|
hdrhistogram.workspace = true
|