Skip to content

chore: add a script that measures idle CPU, wakeups and memory (INC-452) - #525

Merged
arzafran merged 1 commit into
mainfrom
chore/inc-452-measure-idle-script
Nov 3, 2026
Merged

arzafran merged 1 commit into
mainfrom
chore/inc-452-measure-idle-script

Conversation

@arzafran

@arzafran arzafran commented Nov 3, 2026

Copy link
Copy Markdown
Member

What this does

Adds a small dev script that measures how much CPU, how many wakeups and how much memory a running terminal app uses while it sits idle. Run it against Programa, Ghostty or any other terminal on the same machine to get numbers that can be compared directly.

First run on the Release build: 540 to 600 ms of idle CPU per 30 s window, 223 MiB resident, 260 MB physical footprint.

Summary

  • New file scripts/measure-idle.sh, nothing else changes. Takes a PID or an app executable name, plus optional window length (default 30 s) and run count (default 3).
  • CPU comes from ps time deltas, wakeups from top, memory from ps RSS and footprint.
  • Exits non-zero with a message when the name matches zero or several processes.

Test Plan

  • bash -n scripts/measure-idle.sh prints nothing and exits 0 (done).
  • Ran against the Release app by name: prints the table and the memory line (done).
  • Unknown app name: exits 1 with "expected one running ... found 0" (done).
  • PID argument: measures that process (done).
  • Not run: the app test suites, since no app code changed.

Linear: INC-452

Fixes INC-452

@arzafran
arzafran merged commit 534349f into main Nov 3, 2026
12 checks passed
@arzafran
arzafran deleted the chore/inc-452-measure-idle-script branch November 3, 2026 19:27
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