SIGN IN SIGN UP

gpui-fps: Add a realtime FPS and resource HUD crate (#2704)

## Description

A realtime FPS HUD for GPUI applications, added as a new `gpui-fps`
crate: frames per second, frame time, dropped frame rate, and this
process' CPU and memory usage. Frame data comes from GPUI's own frame
trace, so the numbers are what the framework actually spent in
`Window::draw` rather than an estimate measured from the outside.

The crate depends only on `gpui`, so it works in any GPUI application.


https://github.com/user-attachments/assets/e7f68a9a-bc1d-4346-9451-76262ede6770

## Usage

Mount it once in the window's root view:

```rust
div()
    // The HUD positions itself absolutely, so the parent must be relative.
    .relative()
    .size_full()
    .child(content)
    .child(fps_monitor(window, cx))
```

Nothing is drawn until it is switched on, so the mount point can be left
in place permanently.

Neither call takes options. For a different corner or frame budget,
compose the two pieces they use — `FpsMonitor` and `FpsOverlay` — and
render the monitor yourself; it is an ordinary view, so it can sit in a
status bar just as well as in an overlay.

While visible the HUD keeps the window drawing back to back, the way an
in-game counter does, so the reading is the frame rate the application
*can* sustain rather than the rate it happens to be drawing at.

## Try it

In the story, toggle **FPS Monitor** in the settings menu. There is also
a `FpsMonitor` story, and `cargo run -p fps_monitor` runs a standalone
example.

AI-generated with Claude Code, reviewed and iterated on by hand.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
J
Jason Lee committed
7cf072b5843ccf34219e8f5ff552c53537bb404f
Parent: 56f3d90
Committed by GitHub <noreply@github.com> on 8/14/2026, 6:47:46 AM