Improve devenv shell and task warm-start performance#464
Open
schickling-assistant wants to merge 15 commits intomainfrom
Open
Improve devenv shell and task warm-start performance#464schickling-assistant wants to merge 15 commits intomainfrom
schickling-assistant wants to merge 15 commits intomainfrom
Conversation
Storybook Previews
|
Collaborator
797bbd1 to
1d18937
Compare
21e8c79 to
a71e01e
Compare
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.
Summary
devenv shellcan skip unchanged bootstrap workmr:apply, while removingts:emitfrom shell entrypnpm:install,genie:run, and megarepo tasks, and filternoEmitprojects out of thets:emitgraphBenchmarks
All timings below are local wall-clock measurements taken during this PR. Means are arithmetic means of the listed samples.
Warm Shell Progression
7.93s,8.46s,8.56s8.32s0.0%devenv shell --no-tui truebefore removing heavy shell-entry workts:emitfrom shell entry4.45s,4.55s,4.58s4.53s-45.6%ts:emitas a major shell-entry bottleneck0.92s,0.94s,1.10s0.99s-88.1%87b57eb24steady state2.20s,2.23s2.22s-73.3%devenv shell --no-tui trueafter the cache and task-status changes before the setup-fingerprint rewrite797bbd1c7first run after setup-fingerprint invalidation on pinneddevenv 2.0.719.86s19.86s+138.7%797bbd1c7steady state on pinneddevenv 2.0.72.33s,2.16s2.25s-73.0%<3starget797bbd1c7steady state on localdevenv 2.0.6+55d2bb44.97s4.97s-40.3%Notes:
devenv shell --no-eval-cache --no-tui truewas about96s, which remains a separate cold-path / eval problem outside this PR's warm-path scope.devenv 2.0.7runtime is materially faster on the final warm-shell path than the older ambient2.0.6CLI.Setup Fingerprint Bottleneck
1.67s,1.24s,1.15s1.35s0.0%pnpm --version,genie --version, andmr --version, so shell entry paid each CLI startup cost0.53s,0.53s,0.56s0.54s-60.1%setup:gateinside pinneddevenv 2.0.7warm shell382.28ms,393.97ms388.13ms-71.4%vs old direct-gate baselineComparable Warm Task Progression
devenv tasks run pnpm:install --mode single --no-tui4.79s18.26s2.17s,2.21s,2.23s,2.27s,2.44s-52.8%steady-statedevenv tasks run genie:run --mode single --no-tui3.05s4.41s0.73s,0.74s-75.7%steady-statedevenv tasks run ts:emit --mode single --no-tui5.10s7.05s0.40s,0.44s-91.8%steady-stateWarm Task State On
87b57eb24devenv tasks run mr:apply --mode single --no-tui4.34s0.70s,0.71s0.71s-83.6%mr:syncearlierdevenv tasks run genie:run --mode single --no-tui4.41s0.73s,0.74s0.74s-83.2%devenv tasks run pnpm:install --mode single --no-tui18.26s2.17s,2.21s,2.23s,2.27s,2.44s2.26s-87.6%devenv tasks run ts:emit --mode single --no-tui7.05s0.40s,0.44s0.42s-94.0%pnpm:installStatus Bottleneck1397ms,2113mspnpm:install:statuswas the dominant warm-shell child spancompute_workspace_state_hash0.12sto0.14scompute_install_state_hash0.47sto0.50spnpm --version, workspace hash, and GVS links root1.68s,1.70s,1.72s,1.78s,1.90spnpmwarm-status bottleneck0.08s,0.08s,0.08s,0.09s,0.09s-95.1%20xfaster with the same hash semantics via a one-process Node helperdirs + .modules.yaml)0.04s-97.7%vs old full fingerprint0.26sto0.27s-84.8%vs old full fingerprintpnpmFault MatrixThe synthetic fault matrix used to validate footguns looked like this:
node_modulesdirThis is why the PR keeps the current structural warm-status contract and only optimizes its implementation, instead of switching to the lighter hash or to the deeper semantic health check.
Blockers Before Merge
This branch is intentionally strict. The downstream migration needs to land before #464 can merge.
schickling/megarepo-allschickling/gvs-downstream-cleanup: replacemegarepo:*task references withmr:*, passpnpmexplicitly tomk-pnpm-cli, refreshtools/alignment-cli/nix/build.nixpnpmDepsHash, and repinrepos/effect-utils/ workflow-genie imports away frommainschickling/fix-alignment-summary: replacemegarepo:*task references withmr:*, passpnpmexplicitly tomk-pnpm-cli, refreshtools/alignment-cli/nix/build.nixpnpmDepsHash, and repinrepos/effect-utils/ workflow-genie imports away frommainschickling/2026-03-25-pnpm-11: replacemegarepo:*task references withmr:*, passpnpmexplicitly tomk-pnpm-cli, refreshtools/alignment-cli/nix/build.nixpnpmDepsHash, and repinrepos/effect-utils/ workflow-genie imports away frommainschickling/2026-03-17-link-protocol-issue: replacemegarepo:*task references withmr:*, passpnpmexplicitly tomk-pnpm-cli, refresh its branch-specifictools/alignment-cli/nix/build.nixpnpmDepsHash, and repinrepos/effect-utils/ workflow-genie imports away frommainValidation
bash nix/devenv-modules/tasks/shared/tests/setup-cache.test.shCI=1 bash nix/devenv-modules/tasks/shared/tests/pnpm-task-smoke.test.shOTEL_MODE=local CI=1 devenv tasks run nix:test --mode before --no-tuiOTEL_MODE=local CI=1 devenv tasks run check:all --mode before --no-tuimegarepo-allvalidation found the strict downstream migration blockers above; they are intentionally not shimmed in this branchTradeoffs
mr:applystill runs on initial shell bootstrap so the worktree is normalized, but warm shells now skip it when the outer setup fingerprint and inner task caches are unchangedts:emitremains explicit rather than shell-entry work because its correct no-op detection still depends on TypeScript's build planner and is materially slower than the other setup taskspnpmwarm path still uses a structural projection fingerprint rather than the deeper semantic health check; this preserves the existing skip contract while avoiding the shell pipeline overhead that made the status path expensiveActing on behalf of the user.