perf(runtime): consolidate lifecycle and media hot paths#622
perf(runtime): consolidate lifecycle and media hot paths#622JustYannicc wants to merge 21 commits into
Conversation
Review: perf(runtime): consolidate lifecycle and media hot pathsLarge consolidation (6.4k+ / 785-) folding several wave PRs (per the body, replaces #601/#603/#605/#606/#607/#609/#612/#614). Reviewed on its own merits. Most of it is solid leak-hardening and event-driven refactors, but I found one change that looks like an unintended and serious behavior inversion for extension Strengths
Concerns / potential bugs
Suggestions
Verdict: 🔴 Needs changes before merge — concern #1 (crypto/zlib/etc. stub inversion) should be resolved or explicitly justified; #2/#3 are worth addressing. 🤖 Automated review by Claude Code (Opus 4.8). |
|
Addressed the review feedback in What changed:
Verification:
|
What changed
origin/main.scripts/test-*.mjsfor the consolidated behavior.Why
main.Compatibility impact
How tested
node --test 'scripts/test-*.mjs': 84 passed, 2 skipped.npm testbecausepackage.jsondefines it asnode --test 'scripts/test-*.mjs':scripts/test-ai-provider-stream-parser-bounds.mjs,scripts/test-background-refresh-inflight.mjs,scripts/test-cloud-media-buffering.mjs,scripts/test-extension-command-refresh-cache.mjs,scripts/test-extension-fetch-proxy-abort.mjs,scripts/test-extension-lifecycle-sandbox.mjs,scripts/test-extension-runner-multi-command-build.mjs,scripts/test-http-download-binary-cancel.mjs,scripts/test-http-response-decode-async.mjs,scripts/test-native-helper-process-lifecycle.mjs,scripts/test-registry-microtask-lifecycle.mjs.node node_modules/typescript/bin/tsc -p tsconfig.main.json.node node_modules/vite/bin/vite.js build.git diff --check origin/main...HEAD.npm testpassed.node scripts/build-native.mjscould not resolvenode-addon-apifrom this workspace install. No native source was touched by this consolidation.Performance evidence
npm test:scripts/measure-extension-bundle-cache.mjs; local run reported repeated bundle-cache scenarios with 20 iterations in roughly 3.063ms and 2.73ms.Stack validation
codex/consolidate-runtime-lifecycle-final, from currentorigin/main, pushed toJustYannicc.SuperCmdLabs/SuperCmd:main.git diff --stat origin/main...HEADandgit diff --name-status origin/main...HEAD; touched files stay in runtime/lifecycle/media/native-helper scope plus associated Raycast runtime hooks and proof tests.Replaces
perf(runtime): consolidate extension lifecycle and media fixesperf(ai): bound stream parser buffersperf(lifecycle): scope extension timer builtinsperf(extensions): reuse on-demand build stampsperf(background): prevent overlapping refresh ticksperf(runtime): cancel extension HTTP work on abortperf(ipc): harden native helper readinessperf(media): cancel binary fetch downloads