perf(runtime): reduce extension lifecycle and icon churn#558
Open
JustYannicc wants to merge 46 commits into
Open
perf(runtime): reduce extension lifecycle and icon churn#558JustYannicc wants to merge 46 commits into
JustYannicc wants to merge 46 commits into
Conversation
…s' into codex/perf-consolidated-integration-stack
…nd-menubar' into codex/perf-consolidated-integration-stack # Conflicts: # src/renderer/src/raycast-api/hooks/use-cached-promise.ts
…emoji' into codex/perf-consolidated-integration-stack # Conflicts: # src/renderer/src/raycast-api/list-runtime-renderers.tsx # src/renderer/src/raycast-api/list-runtime.tsx
… into codex/perf-consolidated-integration-stack
…tus' into codex/perf-consolidated-integration-stack
… into codex/perf-consolidated-integration-stack # Conflicts: # src/renderer/src/CameraExtension.tsx
This was referenced Jul 3, 2026
Contributor
|
Reviewed the 5 consolidation commits on top of the base validation stack ( Strengths
Concerns / potential bugs
Suggestions
No correctness-blocking bugs found in the reviewable delta. 🟡 Approve with minor comments 🤖 Automated review by Claude Code (Opus 4.8). |
Collaborator
Author
|
Addressed the review follow-up on icon cache staleness. Changes pushed in
Review triage notes:
Proof run locally:
|
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
__SUPERCMD_EXTENSION_RUNTIME_DEBUGwhile preserving warnings/errors.ExtensionViewevaluates bundles with scopedwindow/documentobjects and cleanup-tracked timers/listeners.windowanddocumentparameters.Why
These runtime and extension lifecycle hot paths all reduce repeated native or renderer work that can happen during extension loads, menu-bar refreshes, icon lookups, native helper warmups, and remount/background lifecycles. Keeping them together makes the wrapper/lifecycle ABI merge explicit and preserves the focused performance harness evidence from the smaller fixes.
The native-helper guard closes a lifecycle race where an old helper process could be killed during restart, a replacement process could be spawned, and then the stale old process could still emit exit/stdout events that reset the replacement's readiness, startup promise, or pending request state.
Compatibility impact
globalThis.__SUPERCMD_EXTENSION_RUNTIME_DEBUG = true; warnings and errors still log by default.window,self,global, andglobalThisscoped to the currentExtensionViewduring evaluation.exitcommand and kills the selected child; the cleanup path now only clears shared helper state when that selected child is still the active process.How tested
node --test scripts/test-main-icon-ipc-cache.mjs scripts/test-extension-runtime-logging.mjs scripts/test-menubar-native-image-cache.mjs scripts/test-extension-lifecycle-sandbox.mjs scripts/test-extension-wrapper-cache.mjs(26 passing tests)node --test scripts/test-extension-wrapper-cache.mjs scripts/test-extension-sync-facade.mjs scripts/test-background-no-view-dedupe.mjs scripts/test-extension-runtime-logging.mjs scripts/test-extension-lifecycle-sandbox.mjs(19 passing tests)node --test scripts/test-native-helper-process-lifecycle.mjs(3 passing tests)./node_modules/.bin/tsc -p tsconfig.main.json --noEmit --pretty falsepnpm run build:main./node_modules/.bin/tsc -p tsconfig.renderer.json --noEmit --pretty false./node_modules/.bin/vite buildnode /opt/homebrew/lib/node_modules/npm/bin/npm-cli.js run build:maingit diff --check codex/perf-consolidated-integration-stack..HEADgit diff --check HEAD^ HEADsrc/main/main.tsafter the native-helper lifecycle update.killParakeetServer,ensureParakeetServer,killQwen3Server,ensureQwen3Server,killWhisperCppServer,ensureWhisperCppServer,killAudioCapturer, andwarmAudioCaptureracross the edited helper lifecycle call paths.src/main/icon-ipc-cache.ts,src/main/menubar-native-image-cache.ts,src/renderer/src/ExtensionView.tsx, andsrc/renderer/src/utils/extension-wrapper-cache.ts.getCompiledExtensionWrapperandcreateExtensionLifecycleScopeacross the merged wrapper/lifecycle call paths.Performance evidence
intervals=1,windowListeners=1,documentListeners=1,total=3.total=3, registry seesintervals=1andeventListeners=2, cleanup ends attotal=0.3 -> 0 -> 3 -> 0across prior evaluation cleanup and final unmount.Stack validation
This branch was created from the local
codex/perf-consolidated-integration-stackvalidation stack and then cherry-picked only the assigned fixes from #536, #545, #547, #550, plus the native-helper lifecycle guard commit now included here. The integration-stack head is currently represented upstream by #555; until that stack lands, this PR's GitHub comparison includes those base stack commits plus the consolidation commits here. Renderer typecheck and Vite build were clean on this stack before the native-helper lifecycle follow-up; the follow-up revalidated the focused helper harness, main-process TypeScript no-emit check, main build script, LSP diagnostics/references for the touched main-process lifecycle code, and whitespace checks.Replaces