2023-02-24
Speed up zsh startup time
Terminal startup became noticeably slow. It took me like 1-2 seconds for prompt to show up.
This is for zsh users.
-
Profiling zsh scripts
.zshrc
-
You can see what's being run by running below line
-
Check the time it takes to run zsh scripts
In my case, nvm
(Node Version Manager) was the culprit.
How to fix slow zsh because of nvm
- Comment out scripts generated by nvm
- Use nvm from ohmyzsh plugins
- Defer nvm loading (lazy startup)
Search showed different tactics to speed up on the stackoverflow. However, none of them made any difference in my case.