perf
Measures an open page's frame time, FPS, draw calls, triangles and asset size against a budget, then tests variants to identify what causes stutter or over-budget frames.
Instructions
Measures the open page's frame time (fps), draw calls, triangles and asset size against a budget (desktop by default): it is for a frame a reply reports over budget, or a user who asks about performance (stutter, low fps). To find what costs the frame, give variants: each is measured on a fresh page against the baseline, in this one call, with named objects hidden, a pixel ratio, code run with renderer and scene (shadows or antialias off, a material swapped), or a query the page loads with ("noshadow&pr=0.5", for switches the game reads at load); no reopening or reload code needed. Sampling waits until no element covers the canvas (a loading screen), up to 5 s of the page running, and the load line says what it waited for or sampled under.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| game | No | The name the game was opened under with the `open` tool, to act on ("main" by default; a subagent uses its own). | |
| costs | No | Also list the main scene's visible content by named group (an object goes by its nearest named ancestor, as `look` names it): triangles, those casting shadows, draw calls and texture MB, the 12 groups with the most triangles and the rest in one line. Counted, not timed, with no frustum culling; `variants` with `hide` times a group. | |
| budget | No | desktop, mobile, quest, site (a 3D website: first scene frame within 3 s on fast-4g unless `network` says otherwise, 1 MB of script, 4 MB of assets), or limits to override: { frameMs, assetMB, triangles, drawCalls, textureMax, pixelRatioMax, firstSceneFrameMs, scriptMB }. | |
| network | No | Also time a first visit on this network (Chrome DevTools' presets), in real time with no cache: when the first scene frame came, which bytes came before it by kind (as sent: the harness's own server does not compress, a CDN does) and when an overlay over the canvas went. CPU `throttle` is separate. | |
| throttle | No | Slow the page's JavaScript this many times, as on a weak laptop (4 is a typical one); GPU work is not slowed. | |
| variants | No |