NativeDesktop

Performance

Budgets on the slowest machine, per-view rendering and keeping the main thread free.

The reference machine is e1504g: an Intel Core i3-N305 laptop with an integrated GPU and a 60 Hz panel. If it is smooth there, it is smooth everywhere. Rules in short: donts.md.

Budgets

MeasureBudgetMeasured so far
Cold start to first frameunder 300 ms106 ms median for a bare GPUI window
Idle CPU over 60 s, focused and unfocused0.0%0.000% for a bare GPUI window
Key press to present, p95under 16.7 ms at 60 Hz
Scrolling 100k rowsno missed frames at the display ratep95 17.0 ms, 1 to 2 missed of about 600 frames at 60 Hz (the first frame)
Resident memoryunder 80 MB177 MB for a bare GPUI window while the GL path is still linked
One view's renderunder 1 ms and under 500 nodes

Idle means idle. A still window does no work: no frame runs unless a view is dirty or an animation is live, so a timer that polls or a view that notifies itself every frame shows up as CPU on a window nobody is touching.

How rendering stays cheap

Keep the main thread free

The main thread runs input, layout and every frame. Anything that can take more than a frame goes elsewhere:

Frame timing and monitors

Each window has its own frame clock at its display's refresh rate: 60 Hz on e1504g, 120 Hz ProMotion on a MacBook, 240 Hz and 144 Hz side by side on g815. A window dragged to another display switches clocks. So:

Measuring

nd diag scroll --rows 100000          # scroll a virtual list every frame, check the frame budget
cargo build --release                 # budgets are release numbers; debug builds are not comparable

nd diag scroll passes at no more than 2 missed frames with p95 within 1.25 display periods. On the GPUI hosts ND_ANIMATE=<seconds> re-renders every window every frame for that long and prints the frame line, which is how a heavy view shows its cost. Measure on the slowest machine you have, from a release build, before and after the change, and put the number in the commit or the README.