Recently I’ve noticed that my zsh sessions have become horrendously slow. Here’s how I debugged it.

Measuring Overall Startup Time

time  zsh -i -c exit

Finding the Problematic Plugin

Add the line zmodload zsh/zprof to the top of your ~/.zshrc and at the bottom append the line zprof. This will run and display the costs of running each startup command making it very easy to determine what’s eating your time. For me it was pyenv, which I promptly disabled to cut my startup time in half.