This week I dealt with a problem that had been bugging me. I noticed that the time a took to start a new Zsh terminal session went from essentially instant to around 4 seconds 1. I take some pride in running a lightweight system, so the thought of having to wait a few seconds for my terminal emulator to display a prompt feels like a personal affront. My system wasn't just behaving badly, it was challenging me by way of insult.
Accepting the challenge laid before me, I took to my favorite search
engine to see what tools were available to help me understand what was
suddenly performing so poorly. Oh, okay. This post says that Zsh
includes a script profiler. All I need to do is turn it on in my
.zshrc file, like so: