Optimising my zsh

So recently I noticed the initialisation lag when starting a new zsh session. I decided to fix it and here's what I've learnt.

First of all, credits to this article, which provides a handy way to profile zsh startup stage. Follow the guide in there to profile first, and read on.

How to profile your zsh startup time

My tips #

That's it. There are plenty of resources online of the above for you to search, not gonna cover all of 'em here! Sorry 😜. This is what I've achieved:

$ for i in $(seq 1 10); do /usr/bin/time zsh -i -c exit; done
0.36 real 0.27 user 0.10 sys
0.36 real 0.27 user 0.10 sys
0.35 real 0.27 user 0.10 sys
0.36 real 0.28 user 0.11 sys
0.36 real 0.27 user 0.11 sys
0.35 real 0.27 user 0.10 sys
0.37 real 0.28 user 0.11 sys
0.37 real 0.28 user 0.11 sys
0.40 real 0.29 user 0.12 sys
0.51 real 0.36 user 0.15 sys

You can check out my dotfiles for some inspirations.