docs/perf-energy-issue-139-simulation-report-2026-02-19.md
Date: 2026-02-19 Workspace: /Users/michalkrsik/windsurf_project_folder/CodexBar Issue: https://github.com/steipete/codexbar/issues/139
Determine which suspected culprit(s) can produce the abnormal CPU/energy behavior reported by users, using short reproducible simulations and process-level sampling.
ps, toppowermetrics was unavailable (requires sudo password in this session), so energy was sampled via top POWER proxy.Artifacts:
Summary:
| Scenario | Avg CPU | Max CPU | Avg RSS MB | Avg POWER | Avg IDLEW |
|---|---|---|---|---|---|
| Baseline | 0.00 | 0.10 | 0.54 | 0.00 | 0.00 |
| Culprit A | 113.68 | 117.40 | 121.76 | 0.00 | 0.00 |
| Culprit B | 4.64 | 13.30 | 64.15 | 0.00 | 5.04 |
| Culprit C | 0.25 | 2.30 | 33.12 | 0.00 | 10.43 |
| Combined | 114.62 | 121.30 | 217.62 | 0.00 | 0.00 |
Interpretation:
top sampling mode).Artifacts:
Sampling correction:
top -l 2 and parsed the second sample for tracked PIDs to get non-zero POWER values.Summary:
| Scenario | Avg CPU | Max CPU | Avg RSS MB | Avg POWER | Max POWER | Avg IDLEW |
|---|---|---|---|---|---|---|
| Baseline | 0.00 | 0.00 | 0.55 | 0.00 | 0.00 | 0.00 |
| Culprit A | 113.32 | 115.90 | 114.73 | 94.85 | 150.60 | 6106.70 |
| Culprit B | 4.30 | 10.10 | 62.09 | 2.94 | 4.20 | 2.18 |
| Culprit C | 0.35 | 2.60 | 34.09 | 0.23 | 0.60 | 14.27 |
| Combined | 115.67 | 118.90 | 218.48 | 93.29 | 129.60 | 3858.60 |
Computed checks on pass 2: 10/10 passed.
Primary root-cause class for the extreme behavior is Culprit A (heavy long-lived CLI/subprocess churn under bad/failure paths).
Secondary:
Human-level answer: A tiny toolbar app should never keep heavyweight background subprocess/UI loops alive in failure conditions. That behavior is what creates the abnormal battery/CPU footprint.
CodexBar.app with all real auth/cookie/account paths.powermetrics could not be used in this session due sudo restriction.powermetrics if sudo is available, plus process CPU snapshots.