# perf — budgets and measurements Budgets (targets until measured; CLAUDE.md invariant 4 makes the first one a hard rule): | what | budget | how measured | |---|---|---| | `CGEventTap` callback, p99 | < 1 ms | `os_signpost` interval around the callback, `xctrace` or an in-app counter dumped on quit | | capture → wire (tap callback to `NWConnection.send` enqueue), p99 | < 2 ms | signposts | | Mouse packet end-to-end on a wired LAN (Mac tap → Windows cursor) | < 10 ms | camera-free: Windows side logs receive tick; compare clocks via NTP; or ping-pong a `Hi` and halve | | Heartbeat/idle CPU | < 0.5 % | Activity Monitor over 10 min | | Memory after 8 h soak | flat within 10 MB | `tools/guard.sh` + `ps` sampling | Measurements: none yet. Each lane that touches the hot path appends a dated block here.