brown snail on gray rock
Slow Shell

Having your zsh slow to start is a pain, but here’s some quick and easy ways to find out why, with tools build in to zsh. TL;DR, it’s probably NVM.

Add this to the start of your .zshrc file:

then add this as the last line:

and when you start your zsh session you’ll get a bunch of data on what’s making your startup slow.

For me it was nvm and it deciding what version to run, taking over 5 seconds to decide, when most of the time I don’t use or need nvm. I followed the advice from Aron Schueler over on hs blog and ended up with something like this, and a much faster startup time.

This is my “after” timing, I wasn’t going to write it up, I just Googled slow startup times for zsh and thought I’d write up what I found. Scott Spence also has some advice if your slowdowns don’t come from NVM.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.