perf(tooling): add automated idle profiling harness

Adds `bun run profile:idle`: a fully unattended capture of what OpenChamber
does while nobody interacts with it. It reports main-thread busy time, style
recalculation and layout rates, DOM node and listener growth, heap trajectory,
a CPU sampling profile, and per-call-site attribution of timer, animation
frame, and observer work.

Chrome throttles timers and stops producing frames for occluded or backgrounded
windows, which silently reports an idle-looking renderer regardless of what the
page schedules. Launch flags now disable that throttling, and every run measures
frame liveness so a throttled capture is reported as a warning rather than as a
clean result.

CDP launch and client code is shared with the existing browser profiler.
This commit is contained in:
Bohdan Triapitsyn
2026-08-03 14:20:27 +03:00
parent e0bd787468
commit 255c738b5e
6 changed files with 851 additions and 1 deletions
+2
View File
@@ -69,3 +69,5 @@ workspaces/
.worktrees/
test-results/
artifacts/browser-profile-*/
artifacts/idle-profile-*/
artifacts/idle-*/