6.3 KiB
Rule #1: fluid and light
Arena Tracker must stay as fluid and as light as possible for its user: the app must never feel slow, and it must never make the computer feel slow. Nothing it does, in the foreground or in the background, may be excessive in CPU, memory or rendering.
This rule comes before features. Every change is written to be light; a release that breaks a budget below does not ship, however useful its features are.
Budgets
Measured on the reference machine, on a release build (scripts/prod run). Debug builds are unoptimised and their numbers never count.
| # | Budget | Limit | Current value | Status |
|---|---|---|---|---|
| 1 | Interactions (hover, scroll, sort, filter, moving or resizing the window): cost of one frame | at most 2 ms at the 99th percentile, aiming for 1 ms | 5–7 ms for a full frame of the statistics page; a window move redraws one, 5–8 ms per move at the 95th percentile (before #31) | over budget; to re-measure since #31 |
| 2 | Idle, window visible: CPU | at most 0.5 % of one core on average | 0.3–1.4 % (about 0.8 %) | over budget |
| 3 | Window minimised or hidden | no rendering, CPU close to 0, outside an import | not measured | unknown |
| 4 | Memory, with the full page loaded (every champion and portrait) | at most 150 MB working set | 120 MB working set, 99 MB private | within budget |
| 5 | Background work (import, following the game client) | threads at low priority, never more than one core | not measured | unknown |
Current values measured on 2026-11-16 and 2026-11-17 (issue #17). For information, #31 made a full frame about a third cheaper on the manual checks machine (drawing it: 2.37 → 1.57 ms at the median, 3.72 → 2.50 ms at the 99th percentile, plus 0.22 ms of presentation); its value here is still to measure.
Ratchet
When a measurement shows a budget beaten durably, the limit is lowered to that level, and it is never raised again. Each gain becomes the new floor. Record the change in this table, with the date and the ticket.
Machines
- Reference machine, where budgets are measured: laptop, AMD Ryzen 5 7640U with integrated Radeon 760M graphics, 32 GB, 2256×1504 display at 60 Hz. It is the weakest machine the app runs on: what passes here passes elsewhere.
- Manual checks machine, for what the reference machine cannot show, such as a 240 Hz display: desktop, AMD Ryzen 7 7800X3D, Radeon RX 7800 XT, 32 GB DDR5, 240 Hz display. Its numbers are recorded for information, never as a criterion.
A measurement means something only with its machine and build: the probes print both before their results.
Measuring
Budgets are checked by a full benchmark before each major release (X.0.0; other stables and betas run no probes): every probe below, on a release build, on the reference machine, with the results recorded in the budgets table above. Single changes are not measured, unless the user asks; a release that fails a budget is fixed before it ships, and the probes below (with --features profile) find the cause.
- Window moves and idle CPU:
powershell.exe -ExecutionPolicy Bypass -File scripts/move-probe.ps1 -Title "Arena Tracker"from WSL, with the app open. It moves the window 240 times per second without touching the mouse, after an idle phase.MOVE blockis the time each move holds the UI thread, close to the cost of the frame it causes;IDLE cpuis budget 2. Compare with File Explorer with-Class CabinetWClass. A real title-bar drag (Windows' modal move loop) is not covered: check it by hand. - Champion table hover:
powershell.exe -ExecutionPolicy Bypass -File scripts/hover-probe.ps1 -Title "Arena Tracker"from WSL, with the « Statistiques » tab showing the table under the default band (adjust-Topand-Bottomotherwise). The app opens on « Défi »: open « Statistiques » first, as the band targets its table. After an idle phase, it posts synthetic mouse moves across table rows 240 times per second without touching the real cursor. CompareHOVER cpuwithIDLE cpu;HOVER pingshows how long input waits behind the UI thread while hovering (budget 1). The default band is-X 0.25 -Top 0.62 -Bottom 0.95 -Step 0.04(fractions of the client area, about one row per move in a window at least 800 px tall). Leave the real cursor still over the window, outside the table: when it is outside the window, GPUI sees each synthetic move as the mouse entering then leaving, and refreshes the whole window, bypassing cached views. - Where a frame goes: build with
scripts/prod build --features profile(never for everyday use) and start the app withARENA_TRACKER_PROFILE=<file.csv>(from WSL, pass it throughWSLENV, e.g.WSLENV=ARENA_TRACKER_PROFILE/p:ARENA_TRACKER_HIDE). Every second it appends the frames GPUI drew (draw: total,request_layout,prepaint,paintin ms), their presentation (present) and the views' own time (view, recorded by GPUI from 0.5 ms).ARENA_TRACKER_HIDE=<parts>, read at start, removes parts of the page so that a part's cost is the difference with the full page under the hover probe:header,banners(both tabs), then for « Statistiques »tiles,placements,completed,attempts(the three charts keep their height),tabs,table, and for « Défi »home-header(Season, title and counter),home-tools(filters and search),home-list(its champion table). - Memory: working set of
arena-tracker.exein Task Manager, orGet-Process arena-trackerin PowerShell, once the page is fully loaded. - CI cannot check budgets: its runner is Linux without a GPU, and the app only builds on Windows (ADR-0003). When a change relies on cached views to stay within budget, a structural test (for example, "hovering the table does not render the charts") guards it instead of a timed test. The charts row is the page's one cached view (#31), and « Défi » never renders it (a structural test guards that too). A cached view is laid out from its style alone, never its content, so only a part whose size does not depend on its content can be one. A view that is not cached renders again with its parent and saves nothing, while its state must be kept in sync; a window move bypasses every cache.
GPUI and gpui-component are not modified to meet a budget: the app's own rendering cost is the lever (ADR-0004).