Oh-my-zsh is becoming unbearably slow…
I’m not a computer science expert, so I always choose to bear with the small issues happing on my laptop. My personal as well as working laptops are all Mac. And I use iTerm2 and Oh-My-Zsh to replace the default Terminal. For the zsh theme, I recommend
One of the costs of using Oh-my-zsh is that the startup times are slow. That’s what everyone says.
But recently, I am getting more and more frustrated by the slow startup times. By searching online, I found this tutorial really helpful.
The following are the steps I took to improve my oh-my-zsh experience:
Let’s measure how long it takes to start a new shell session:
5.5 seconds??? That is not good at all.
Now, please pay attention. Run the following command in your Terminal, and take note of the portion where the output pauses a bit.
For my case, I found the portion for setting
hadoop & hive parameters, and also for setting up
nvm tend to get stuck for a while.
As I don’t need
nvm that often, I decided to prevent them from auto-loading during starting up zsh.
So I made the following changes in my
- Comment out the Hadoop Hive exports commands
- Comment out the nvm loading command. Instead, create an alias for it so that I can easily load it when I need it.
That’s all~ Now let’s quite the Terminal and reopen it.
Test the time again: