I was trying to understand why it takes a significant amount of time (like a few seconds) to start a new zsh session.
I spent a few hrs yesterday optimizing #zsh startup time.
Thread
Key learnings:
- turn off plug-ins that you didn't use. I enabled it "just in case I would use," and I never did. For example, I got rid of rbenv (later in this thread) and removed the zsh plugin.
- revisit some unused ohmyzsh plugins (some old "custom" plug-ins took significant time to load)
I had zsh plugin for @kapeli dash that was super old (and not optimized)
I use zplug to manage my plug-ins. Excellent thing that zplug caches a lot of those. Always use ZPLUG_CACHE.
Also, zplug has `zplug load --verbose` to show what's loading.
And `zplug log` to see errors from modules.
Learned to profile using zprof.
I'm planning to understand its output more. I believe I can find some hot spots in the future.
but old good
time zsh -i -c echo
That shows effective startup time works great!
I was able to quickly understand the impact of adding individual plug-ins/configs to startup time.
- `brew --prefix` is too damn slow. Replaced with a path to the binary
- Replaced `rbenv` with chruby
- replaced `rupa/z.sh` (to jump around folders) with z.lua
After listening almost exclusively during last weekend, I can say Traveling of @TheRealRoxette is probably one of the most underrated albums. Notable hits in 🧵
I had a similar situation during my @kafkastreams
talk on @devnexus. I was using #Starwars metaphor to explain «event time» vs «processing time». And I also mentioned, «Machete order» of watching #Starwars. And the author of «Machete order» was in a room @rodhilton