Measure frames, draw calls and GPU resources
three_perfMeasure page draw calls, triangles, shader programs, geometries, textures, JS heap, and frame-time percentiles. Check budgets and compare results with the prior run to validate performance changes.
Instructions
Measure a page for some seconds (after optional steps): draw calls and triangles per frame, shader programs, geometries and textures (exact, the same on every GPU), JS heap, and frame-time percentiles with the slowest frames and their cause (shader compile, GPU upload, draw calls, JS). Checks budget and compares with the last run of the same name (kept in .threesmith/perf/). Frame times come from software rendering: use them before/after on the same machine, not as real fps. Measure before and after every performance change.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"target": "<target>"
},
"name": "three_perf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | name of the measurement for the comparison (default: the entry file) | |
| root | No | folder to serve when the page needs files above its own folder | |
| save | No | keep this run for the next comparison (default true) | |
| wait | No | ||
| entry | No | ||
| steps | No | Steps in order: {"type":"click","selector":"#start"} or {x,y}, {"type":"press","key":"Space"}, {"type":"hold","key":"ArrowRight","ms":300}, {"type":"drag","from":[x,y],"to":[x,y]}, {"type":"wheel","deltaY":200}, {"type":"wait","ms":500}, {"type":"wait-for","selector":"canvas"}, {"type":"frames","n":10}, {"type":"eval","js":"app.start()"}, {"type":"until","js":"$('ball').position.y < 0","timeout":5000}. | |
| width | No | ||
| budget | No | limits: frameMs (p95), calls and triangles (max per frame), textures, geometries, programs | |
| height | No | ||
| ignore | No | ||
| target | Yes | Folder with the page (index.html), or the http(s) URL of a running dev server. | |
| webgpu | No | ||
| seconds | No | how long to measure (default 5) |