logoalt Hacker News

Bringing down my ZSH load times from ~3.1s to ~230ms

31 pointsby speckxyesterday at 5:37 PM13 commentsview on HN

Comments

jasonpeacocktoday at 2:28 AM

Huh, I just ran the same timing command for my fish shell (with starship prompt) and got 168ms.

What all is happening in the Zsh profile?

AprilArcusyesterday at 6:48 PM

How did I know it was going to be `nvm` before I clicked?

show 1 reply
tecoholictoday at 12:15 AM

Use mise and you will be in the micro-seconds region.

https://arunmozhi.in/2024/09/06/replacing-pyenv-nvm-direnv-w...

ricardobeatyesterday at 8:37 PM

Having gone through the same experience, I suggest dropping fnm as well; I don’t recall what exactly causes it, but it will eventually slow down too.

I’ve been using mise [1] to manage node versions since with zero issues.

[1] https://mise.jdx.dev

show 1 reply
basetensucksyesterday at 8:55 PM

Adopting https://github.com/marlonrichert/zsh-snap was probably the best decision I've made around zsh in the last five years.

jauntywundrkindtoday at 12:17 AM

My mini-story: I'd switched to zimfw which does a ton of caching, precompiling. It benches very well versus other zsh frameworks. But something was still taking almost a second for me, every time. https://github.com/zimfw/zimfw

zprof helped me and the LLM profile and we found it was one plugin, which wasn't really intended specifically for zim. Fixed that! https://github.com/lipov3cz3k/zsh-uv/issues/2

Man it feels so good having shells just open so lightning fast.