You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #690 / #691 (deterministic output order — this proposal builds on top of it).
Problem
env-state.json lives in the per-session temp dir (tmp/<date>-<pid>/), so a brand-new shell always starts cold: its first two hook runs do full rebuilds (every plugin's EnvKeys lua evaluation; two rounds are needed to reach the PATH fixed point). The cost scales with plugin count — and worse, any plugin that touches the network while loading turns every new terminal into a network-bound operation. Example: vfox-ruby fetches a GitHub manifest at require time, adding 0.3–1.2s per rebuild through a proxy, or hanging vfox activate entirely when the network path black-holes (see #693).
Measured with 7 plugins installed: pure lua rebuild ≈ 30ms; with vfox-ruby's manifest fetch ≈ 1.2s per new session; with a black-holed proxy: indefinite hang (>60s, killed manually).
Proposal: a second-level, machine-global, content-addressed cache
Consulted between the session fast path and the full rebuild:
Key = SHA-256 of (vfox version, shell name, raw $PATH, global config path+mtime, project config path+mtime) — exactly the inputs HasChanged already checks.
Strict sharing eligibility so session semantics are untouched:
sessions with a session-scope config never read or write shared entries;
outputs referencing the session shim dir are never published;
legacy-version-file setups are excluded;
degraded rebuilds (any SDK failing plugin load / symlink / EnvKeys) are never published.
Entries written atomically (temp file + rename), verified against the full serialized key on lookup, pruned on the existing daily CleanTmp cadence (30-day TTL, 256-entry cap).
Running locally for a while now: xooooooooox@0a74b7c (branch patched-v1.0.11, +472 lines incl. unit tests). Result: new-session first hook run 1.2s → 22ms; cache hits skip plugin loading entirely, so shells stay responsive even when a plugin's network dependency is down.
Happy to adapt this into a PR if the direction works for you.
Follow-up to #690 / #691 (deterministic output order — this proposal builds on top of it).
Problem
env-state.jsonlives in the per-session temp dir (tmp/<date>-<pid>/), so a brand-new shell always starts cold: its first two hook runs do full rebuilds (every plugin'sEnvKeyslua evaluation; two rounds are needed to reach the PATH fixed point). The cost scales with plugin count — and worse, any plugin that touches the network while loading turns every new terminal into a network-bound operation. Example: vfox-ruby fetches a GitHub manifest atrequiretime, adding 0.3–1.2s per rebuild through a proxy, or hangingvfox activateentirely when the network path black-holes (see #693).Measured with 7 plugins installed: pure lua rebuild ≈ 30ms; with vfox-ruby's manifest fetch ≈ 1.2s per new session; with a black-holed proxy: indefinite hang (>60s, killed manually).
Proposal: a second-level, machine-global, content-addressed cache
Consulted between the session fast path and the full rebuild:
$PATH, global config path+mtime, project config path+mtime) — exactly the inputsHasChangedalready checks.CleanTmpcadence (30-day TTL, 256-entry cap).Working implementation
Running locally for a while now: xooooooooox@0a74b7c (branch
patched-v1.0.11, +472 lines incl. unit tests). Result: new-session first hook run 1.2s → 22ms; cache hits skip plugin loading entirely, so shells stay responsive even when a plugin's network dependency is down.Happy to adapt this into a PR if the direction works for you.