Skip to content

gpui: Unify performance tracking under the profiler feature - #62496

Merged
Anthony-Eid merged 5 commits into
mainfrom
anthony-eid/frame-profiler-unification-7f4c
Aug 14, 2026
Merged

gpui: Unify performance tracking under the profiler feature#62496
Anthony-Eid merged 5 commits into
mainfrom
anthony-eid/frame-profiler-unification-7f4c

Conversation

@Anthony-Eid

@Anthony-Eid Anthony-Eid commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

GPUI currently splits performance instrumentation across several Cargo features and runtime controls. Task profiling, frame-duration histograms, input-latency histograms, and benchmark frame timing therefore follow separate code paths despite measuring related parts of the same UI work.

This PR consolidates those systems under the profiler Cargo feature. The bench feature now enables profiler, aggregate frame and input-latency histograms remain active whenever profiling is compiled in, and set_trace_enabled controls whether individual task timings and per-frame draw and presentation records are retained.

The change also introduces a single per-window profiler that owns the begin and end state for input dispatch, drawing, and presentation, and routes window action-handler timing through the existing aggregate action tracker. Draw and presentation records reuse the same timestamps and computed intervals as the aggregate histograms, avoiding duplicate clock reads. Benchmark trace scopes are reference-counted so overlapping measurements cannot disable tracing while another measurement still needs it.

This does not change hang detection directly. It establishes the common profiling foundation needed to correlate slow or delayed frames with actions and foreground or background tasks. Better attribution should make it easier to find and prevent responsiveness regressions.

Release Notes:

  • N/A

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 11, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Aug 11, 2026
@Anthony-Eid
Anthony-Eid force-pushed the anthony-eid/frame-profiler-unification-7f4c branch from a8bc784 to 4100670 Compare August 12, 2026 17:49
@Anthony-Eid
Anthony-Eid force-pushed the anthony-eid/frame-profiler-unification-7f4c branch from 4100670 to 82fd318 Compare August 12, 2026 18:16
@Anthony-Eid
Anthony-Eid added this pull request to the merge queue Aug 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2026
…filer-unification-7f4c

# Conflicts:
#	crates/gpui/src/app/bench_context.rs
@Anthony-Eid
Anthony-Eid enabled auto-merge August 14, 2026 16:30
@Anthony-Eid
Anthony-Eid added this pull request to the merge queue Aug 14, 2026
Merged via the queue into main with commit a21007b Aug 14, 2026
36 checks passed
@Anthony-Eid
Anthony-Eid deleted the anthony-eid/frame-profiler-unification-7f4c branch August 14, 2026 16:36
playdohface pushed a commit to playdohface/zed that referenced this pull request Aug 29, 2026
…stries#62496)

GPUI currently splits performance instrumentation across several Cargo
features and runtime controls. Task profiling, frame-duration
histograms, input-latency histograms, and benchmark frame timing
therefore follow separate code paths despite measuring related parts of
the same UI work.

This PR consolidates those systems under the `profiler` Cargo feature.
The `bench` feature now enables `profiler`, aggregate frame and
input-latency histograms remain active whenever profiling is compiled
in, and `set_trace_enabled` controls whether individual task timings and
per-frame draw and presentation records are retained.

The change also introduces a single per-window profiler that owns the
begin and end state for input dispatch, drawing, and presentation, and
routes window action-handler timing through the existing aggregate
action tracker. Draw and presentation records reuse the same timestamps
and computed intervals as the aggregate histograms, avoiding duplicate
clock reads. Benchmark trace scopes are reference-counted so overlapping
measurements cannot disable tracing while another measurement still
needs it.

This does not change hang detection directly. It establishes the common
profiling foundation needed to correlate slow or delayed frames with
actions and foreground or background tasks. Better attribution should
make it easier to find and prevent responsiveness regressions.

Release Notes:

- N/A

---------

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants