6 ms·
I just want to say - thank you! I've been using ZSH since it became the default on macOS and one thing that started annoying me recently is the slow startup tim
by nikolatt 2y ago
I just want to say - thank you! I've been using ZSH since it became the default on macOS and one thing that started annoying me recently is the slow startup time. Your snippet tangibly improved that.
Do you by chance have any good resources on optimising my config further?
- bongobingo1 2y agoBeyond zprof (https://www.bigbinary.com/blog/zsh-profiling https://www.bigbinary.com/blog/zsh-profiling) not really I'm afraid. I did the majority of my zsh-prompt hacking 10 years ago and haven't thought about it since. That snippet could be from anywhere. You could peek at something like zprezto https://github.com/sorin-ionescu/prezto https://github.com/sorin-ionescu/prezto or pure https://github.com/sindresorhus/pure https://github.com/sindresorhus/pure for tips. Fetching git/hg/... info is always slow, so try and speed that up where you can (as to how to do that, uhh... I know my prompt has a dirty-state check nicked from pure for speed reasons). You can also cache any `asdf init zsh` or similar to a file and do the same "run in background" trick so the next shell will have any changes. The biggest improvement I can remember was dropping zprezto for my own much smaller config, I really did not need much comparatively. Mostly some git info and "good default" options. I use zgenom for a plugin manager but only have 3 plugins, probably I should just dump it and inline the plugins to avoid getting owned one day.
- bongobingo1 2y agoYou may be interested in this lazy completion loader https://news.ycombinator.com/item?id=40140873 https://news.ycombinator.com/item?id=40140873