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
{{ message }}
Repository navigation
[perf][P1] $(...) inside PS1 renders ~100x slower than the same call in PROMPT_COMMAND - four oh-my-bash themes hit 10x rr budget on CI #604
Evidence (ablation, three machines, same ordering)
Replay per the v1.4.0 perfbudget gate (run 38462805309 + local): omb themes axin/clean/simple/sexy embed $(scm_prompt_info)-style command substitutions directly in PS1. Their rerender (rr) medians: 336-1566ms vs 35-60ms for rr-healthy themes in the same class — 10x over the 120ms class budget, 5x over the hard-fail line.
Ablation (axin, pristine master, N=3, pins unchanged): pristine rr 1566ms; removing the embedded $(scm_prompt_info) from PS1 → 110ms (−93%); removing $(date) → 1575ms (no change); removing venv probe → 1587ms (no change). The substitution itself is the cost.
The 100x split: the same call placed in PROMPT_COMMAND runs 20-75ms on the same machines — so this is not just Windows spawn floor (#375 family, ~40ms). Two compounding halves:
Per-render spawn: PS1-embedded $(...) re-forks on EVERY rerender, PROMPT_COMMAND runs it once per prompt cycle in-process context.
Engine path gap (rubash-fixable): command substitution reached through the prompt-string expansion path is 7-20x slower than the same call via PROMPT_COMMAND (544-1566ms vs 20-75ms in-process) — the expansion path is leaving something on the table (state re-init, missing fast path, or per-call setup that PROMPT_COMMAND doesn't pay).
Fix directions (fix-lane, one change converges all four themes)
Profile the prompt-expansion path's command substitution vs the PROMPT_COMMAND path; close the 7-20x in-engine gap.
Consider a guarded cache for idempotent-ish prompt substitutions ONLY if semantically safe (git-status caching has staleness semantics — needs owner ruling).
Impact
omb axin/clean/simple/sexy + bashit sexy/font/sirup rr budgets currently need 1200-2600ms overrides (recorded in scripts/perf/budgets.toml with ablation data). Fixing the engine path lets the overrides drop back to class-normal.
Data cross-refs: niubash scripts/perf/budgets.toml overrides + justifications (v1.4.0 release gate), CI run 38462805309 timing log.
Activity
fix(prompt): PS1/PS0 render keeps the reader's $? and PIPESTATUS (#604)…
fix(builtins,prompt): #759 builtin divergences (shift usage status, z…