Skip to content

Fix monitoring performance and reliability - #18

Merged
qaid merged 2 commits into
mainfrom
performance-fixes
Aug 25, 2026
Merged

Fix monitoring performance and reliability#18
qaid merged 2 commits into
mainfrom
performance-fixes

Conversation

@qaid

@qaid qaid commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace per-tick nettop -L 1 (5 s per call, so the "1 s" loop ran every ~6 s and showed speeds ~6x too high) with one persistent nettop -L 0 -s 1 stream; speeds are now delta / measured elapsed time
  • Read pipes before waitUntilExit() in the netstat and lsof readers (output > 64 KB deadlocked the monitor loop and froze the app)
  • Give Connection a stable id so expanded rows are not rebuilt and DNS lookups do not refire every second
  • Run lsof only while the detail panel is visible
  • Batch history writes into one SQLite transaction every 10 s (WAL mode, cached DateFormatter, pruneOldData now runs at launch)

Test plan

  • swift build passes
  • App launches, one nettop child, ~1% CPU, child exits on quit
  • Menu bar speed matches Activity Monitor
  • App list appears ~5 s after launch and updates each second

🤖 Generated with Claude Code

https://claude.ai/code/session_01G2229uhWSPYZC5KrJNvGBF

@qaid
qaid merged commit c4b403a into main Aug 25, 2026
1 check failed
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