Skip to content

feat(desktop): improve hot renderer diagnostics#640

Merged
huntharo merged 3 commits into
mainfrom
fix/hot-cpu-per-core-profile
Jun 5, 2026
Merged

feat(desktop): improve hot renderer diagnostics#640
huntharo merged 3 commits into
mainfrom
fix/hot-cpu-per-core-profile

Conversation

@huntharo
Copy link
Copy Markdown
Contributor

@huntharo huntharo commented Jun 5, 2026

Summary

  • derive hot renderer cpuPercent from cumulative CPU-seconds over wall time so one busy core reports near 100% instead of Electron's machine-normalized 4-6%
  • keep Electron's raw normalized reading as electronCpuPercent in samples for debugging/comparison
  • add Settings -> General -> Developer mode controls for hot CPU profiling and one-shot smart heap snapshots
  • capture bounded heap snapshot batches around hot CPU profiles: start/stop for 2 snapshots, start/mid/stop for 3 snapshots
  • auto-clear the smart heap snapshot setting after the configured snapshot budget is consumed, while leaving CPU profiling available
  • reconfigure a running renderer profiler when diagnostics settings change, so no app restart or dock-launch env var is required

Test Plan

  • /Users/huntharo/.nvm/versions/node/v24.16.0/bin/pnpm test apps/desktop/src/main/__tests__/renderer-hot-cpu-profiler.test.ts apps/desktop/src/main/__tests__/desktop-settings-patch-translator.test.ts apps/desktop/src/main/__tests__/desktop-settings-service.test.ts apps/desktop/src/renderer/src/features/settings/__tests__/settings-screen.test.tsx packages/shared/src/contracts/__tests__/settings.test.ts apps/desktop/src/renderer/src/__tests__/app-shell.test.tsx
  • /Users/huntharo/.nvm/versions/node/v24.16.0/bin/pnpm --filter @pwragent/desktop typecheck
  • /Users/huntharo/.nvm/versions/node/v24.16.0/bin/pnpm --filter @pwragent/shared typecheck

@huntharo huntharo changed the title fix(desktop): profile renderer CPU by core usage feat(desktop): improve hot renderer diagnostics Jun 5, 2026
@huntharo huntharo merged commit aa9ae93 into main Jun 5, 2026
6 checks passed
@huntharo huntharo deleted the fix/hot-cpu-per-core-profile branch June 5, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant