Investigate zsh interactive startup performance #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Zsh interactive startup feels slow. Measure it, find the hotspots, and fix the biggest offenders.
How to measure
Suspected offenders (from reading the current config)
compinit—.zshrcrunsautoload -Uz compinit; compinitin the OpenSpec block, then Oh My Zsh (00-oh-my-zsh.zsh→oh-my-zsh.sh) runs its owncompinit. That's two full completion-dump scans per startup. Considercompinit -C(skip dump check) or letting OMZ own it entirely.. "$NVM_DIR/nvm.sh"in.zshrcis a classic 100–300 ms hit. Lazy-load it (stubnvmfunction that self-replaces on first call) or drop it if a system Node suffices.eval "$(direnv hook zsh)"— forks a process every startup; small but real. The OMZdirenvplugin (per the existing TODO) is marginally cheaper.gpgconf --list-dirs agent-ssh-socket— another fork per startup. The socket path is stable; cache it or set it once in.zshenv/environment.eval "$(rbenv init - --no-rehash zsh)"also forks. Same lazy-load treatment applies._aidevops_terminal_titleruns 3git rev-parseforks per prompt, not just at startup. Worth folding into onegitcall or caching.zshrc.dglob loop — sources every file unconditionally; fine in itself, but makes per-file timing (above) the right way to spot anything unexpected hiding in20-functions.zsh/30-aliases.zsh/ theextra-*package fragments.Acceptance criteria
hyperfine 'zsh -i -c exit'number recorded in this issuezprofoutput analyzed; top 3 offenders identified