What we know so far
After fixing the eager conda shell.zsh hook and a .zshrc.devboost double-source
bug this session, synthetic timing (zsh -i -c exit, and zprof) shows shell
initialization itself down to ~0.2s, dominated by zinit plugin loading (~55%) and
_mise_hook (~25%).
However, real-world observed time from opening a new terminal window/tab to a usable
prompt is still 1.5-2 seconds — a ~1.3-1.8s gap that zsh -i -c exit structurally
can't see, because it exits immediately without ever reaching an actual interactive
prompt render.
Suspects (not yet confirmed)
- iTerm2 shell integration handshake (
~/.iterm2_shell_integration.zsh is sourced,
179 lines) — may have its own async round-trip cost separate from zsh's own init.
compinit/completion cache: found 9 different stale .zcompdump* files on this
machine, tied to different old hostnames/machine names (Rolfs-2021-MBP,
Rolf's MacBook Pro, Rolfs-MacBook-Pro, Rolfs-MacBook-Pro-2, two different
macbookpro.lan PIDs). compinit's default hostname-based cache-file lookup may be
missing the "right" cache or doing extra work because of this — worth checking
whether it's silently doing a full rebuit (which stats every function in $fpath,
a well-known multi-second cost) versus using a cache.
- Two active plugin managers (see the znap→zinit issue) doing genuinely redundant
plugin-loading work, on top of whatever startup overhead each carries individually.
- Terminal-app-side rendering/GPU cost, unrelated to the shell at all — needs to be
ruled in/out separately from anything zsh-side.
Next steps
- Get an accurate time-to-first-prompt measurement that isn't
zsh -i -c exit (e.g.
a precmd hook that timestamps and writes to a file, triggered from a genuinely
fresh interactive shell — not a nested/synthetic one).
- Clean up stale
.zcompdump* files and re-measure.
- Re-measure after the znap→zinit consolidation lands (should remove one full
redundant plugin-manager init).
- If a large gap remains, profile iTerm2 integration and terminal-app-level startup
separately from the shell itself.
Relates to
- The environment-health-checks module issue (stale .zcompdump as a checkable item).
- The znap→zinit consolidation issue (redundant plugin manager as a contributing cause).
What we know so far
After fixing the eager
conda shell.zsh hookand a.zshrc.devboostdouble-sourcebug this session, synthetic timing (
zsh -i -c exit, andzprof) shows shellinitialization itself down to ~0.2s, dominated by
zinitplugin loading (~55%) and_mise_hook(~25%).However, real-world observed time from opening a new terminal window/tab to a usable
prompt is still 1.5-2 seconds — a ~1.3-1.8s gap that
zsh -i -c exitstructurallycan't see, because it exits immediately without ever reaching an actual interactive
prompt render.
Suspects (not yet confirmed)
~/.iterm2_shell_integration.zshis sourced,179 lines) — may have its own async round-trip cost separate from zsh's own init.
compinit/completion cache: found 9 different stale.zcompdump*files on thismachine, tied to different old hostnames/machine names (
Rolfs-2021-MBP,Rolf's MacBook Pro,Rolfs-MacBook-Pro,Rolfs-MacBook-Pro-2, two differentmacbookpro.lanPIDs).compinit's default hostname-based cache-file lookup may bemissing the "right" cache or doing extra work because of this — worth checking
whether it's silently doing a full rebuit (which stats every function in
$fpath,a well-known multi-second cost) versus using a cache.
plugin-loading work, on top of whatever startup overhead each carries individually.
ruled in/out separately from anything zsh-side.
Next steps
zsh -i -c exit(e.g.a
precmdhook that timestamps and writes to a file, triggered from a genuinelyfresh interactive shell — not a nested/synthetic one).
.zcompdump*files and re-measure.redundant plugin-manager init).
separately from the shell itself.
Relates to