Skip to content

perf(system): gate auto-quit AppleScript probes#483

Closed
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-auto-quit-probes
Closed

perf(system): gate auto-quit AppleScript probes#483
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-auto-quit-probes

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

Summary

  • Gate auto-quit AppleScript probes behind due-candidate checks.
  • Cache tracked bundle IDs and tracked music bundle IDs so each poll can prune and decide probe needs without rebuilding sets.
  • Add focused auto-quit instrumentation/tests for no-due, due, frontmost, recording, and music gating behavior.

Metrics

  • Before: no tracked app due over 3 ticks = 9 osascript calls (frontmost 3, recording 3, music 3, quit 0).
  • After: no tracked app due over 3 ticks = 0 osascript calls.
  • Before: one non-music app due = 4 osascript calls (frontmost 1, recording 1, music 1, quit 1).
  • After: one non-music app due = 3 osascript calls (frontmost 1, recording 1, music 0, quit 1).

Validation

  • node scripts/test-auto-quit-manager.mjs
  • node scripts/test-auto-quit-manager.mjs --metrics
  • node --test scripts/test-*.mjs
  • pnpm run build:main
  • Codex LSP diagnostics on src/main/auto-quit-manager.ts: no diagnostics found

Risks

  • The manager now samples the frontmost app only once at least one tracked app reaches its due time. This is the intended probe reduction, but it means short foreground activations between due checks are not observed until a due candidate exists.

@JustYannicc JustYannicc changed the title [codex] Gate auto-quit AppleScript probes perf(system): gate auto-quit AppleScript probes Jul 3, 2026
@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by consolidated upstream PR #534 (perf(mac): reduce native polling and async IO stalls), which carries this change together with the related macOS/native/audio/camera async IO performance fixes. Closing this source PR so review can continue on #534.

@JustYannicc JustYannicc closed this Jul 3, 2026
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