perf(mac): reduce native polling and async IO stalls#534
Open
JustYannicc wants to merge 4 commits into
Open
Conversation
This was referenced Jul 3, 2026
Contributor
|
Reviewed the full diff plus the surrounding code (settings broadcast wiring, notes-store callers, clipboard call sites, Swift BFS bounds). This is a clean, well-tested batch of behavior-preserving perf refactors — moving synchronous/native work off idle-poll and launcher-show hot paths. Strengths
Concerns / potential bugs (all minor — none blocking)
Suggestions
🟡 Approve with minor comments 🤖 Automated review by Claude Code (Opus 4.8). |
Collaborator
Author
|
Addressed the review notes from the async/native perf pass:
Verification:
Also rechecked GraphQL review state: |
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.
What changed
removeFirst()traversal with index-cursor queues in native selected-text/caret paths.aerospacecommands.onSettingsUpdatedlistener sync.Why
Several macOS-facing paths were doing synchronous or repeated work during idle polling, launcher visibility changes, autosave bursts, clipboard history changes, and camera capture. Consolidating the related fixes lets upstream review the native polling and async IO stall reduction together while preserving existing user-facing behavior.
Compatibility impact
How tested
node scripts/test-auto-quit-manager.mjsnode scripts/test-auto-quit-manager.mjs --metricsnode scripts/test-aerospace-workspace.mjsnode scripts/test-speak-settings-listener.mjsnode scripts/test-notes-async-saves.mjsnode scripts/test-clipboard-history-persistence.mjsnode scripts/test-camera-capture-single-encode.mjsswift scripts/bench-ax-bfs-queue.swiftswiftc -O -o /tmp/supercmd-native-validation/get-selected-text src/native/get-selected-text.swift -framework Foundation -framework ApplicationServices -framework AppKitswiftc -O -o /tmp/supercmd-native-validation/emoji-trigger-monitor src/native/emoji-trigger-monitor.swift src/native/ax-caret-query.swift -framework AppKit -framework ApplicationServicesswiftc -O -o /tmp/supercmd-native-validation/audio-capturer src/native/audio-capturer.swift -framework AVFoundation -framework Foundationpnpm exec tsc -p tsconfig.main.json --noEmit --pretty falsepnpm testpnpm exec tsc -p tsconfig.renderer.json --noEmit --pretty falsefails on the standalone branch because of existing repo-wide renderer typing debt unrelated to this consolidation.Performance evidence
osascript=0,frontmost=0,recording=0,music=0,quit=0.frontmost=1,recording=1,quit=1,music=0.removeFirst=2547.65ms, cursor queue1313.94ms, speedup1.94x.writes=1,syncWrites=0,asyncWrites=1, latest state flushed.coalescedWrites=1,blockingMs=0.42, and quit/clear/delete flush paths are covered.toBlobonce, never callstoDataURL, and revokes preview object URLs on clear/unmount.onSettingsUpdatedlistener and no polling interval.Stack validation
Standalone renderer typecheck still hits existing repo-wide renderer typing debt. Applied this consolidation over #532 (
fix(validation): restore project checks,JustYannicc:codex/consolidate-validation-checks) and validated the combined stack:pnpm exec tsc -p tsconfig.renderer.json --noEmit --pretty falsepnpm testReplaces