Repository navigation
test: add a script that measures the app's CPU with sample data - #109
Merged
Merged
Conversation
The CPU problems in #90 were found only after release, on the installed app. scripts/measure-cpu.sh catches them before one: it builds the Debug app, runs it with --demo --live-readings, and prints the CPU of the app and the window server for each dashboard page in front, the window in the background and the window closed. It never takes the keyboard or moves the mouse. Two debug-only launch arguments make that possible: --background shows windows without activating the app, on the Mac's own screen when another display is connected, and --appear-active draws the dashboard as if it were in front. CONTRIBUTING and AGENTS.md say to run it after dashboard changes and before a release. Refs #90 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
yogeshprasad098
added a commit
that referenced
this pull request
Nov 27, 2026
The CPU problems in #90 were found only after release, on the installed app. scripts/measure-cpu.sh catches them before one: it builds the Debug app, runs it with --demo --live-readings, and prints the CPU of the app and the window server for each dashboard page in front, the window in the background and the window closed. It never takes the keyboard or moves the mouse. Two debug-only launch arguments make that possible: --background shows windows without activating the app, on the Mac's own screen when another display is connected, and --appear-active draws the dashboard as if it were in front. CONTRIBUTING and AGENTS.md say to run it after dashboard changes and before a release. Refs #90
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #90
The CPU problems in #90 showed up only after release, on the installed app. This adds
scripts/measure-cpu.shto catch them first. It builds the Debug app, runs it with--demo --live-readings, and prints the CPU of Chargectl and the window server for each dashboard page in front, the window in the background and the window closed.It never takes the keyboard or moves the mouse. Two debug-only launch arguments make that possible:
--backgroundshows windows without making the app active, on the Mac's own screen when another display is connected, and--appear-activedraws the dashboard as if Chargectl were in front, so the in-front cost is measured without focus. CONTRIBUTING and AGENTS.md say to run it after dashboard or menu bar changes and before a release.Review focus
Dashboard.showreturns early in--backgroundmode, afterorderFrontRegardless. Both arguments are read only in Debug builds; Release builds ignore them.Testing
Tested on an M3 MacBook Air with an external display, macOS 27.2.1. Run on
main(the Core Animation fix from #108) while I kept working on the other display. The window opened on the built-in screen, the front app stayed mine throughout (checked withlsappinfo frontevery 2 s), and the test app quit at the end:The Chargectl column matches a run with the app really in front (5.9, 1.4, 6.2, 0.5, 2.3%). The WindowServer column counts every app on both screens, so it moved with what else was open; CONTRIBUTING says to read it only as a rough guide.
./scripts/check.shpasses;shellcheck -x -S warningis clean.CHANGELOG.mdhas an entry under Unreleased saying what a user now sees, or nothing user-visible changed.!in the title and the migration above.