Re:Why does zsh start so slowly?
by rphln on Sunday November 13, 2022 @06:54AM
(#33582219)
I recently had the same problem with Conda's and Pandoc's initializations in Bash.
At first I did the same as the author and just dumped the output from `pandoc --bash-completion` et al. into a file, but then I'd have to deal with cache invalidation on every machine that I use. Doing it manually isn't that bad, but remembering to update the file in a bunch of machines is a bit too much ugly for me.
After a surprisingly short Google session, I ended up settling with lazy initialization [1]. Unlike the post I found, I did it all manually, though. Now I just have this tucked at the end of my `.bashrc`:
Re:Why does zsh start so slowly?
by paulirish on Sunday November 13, 2022 @12:14PM
(#33585020)
I've also spent time profiling shell startup and found conda's init wasn't fast. (And that's consistent in fish shell, tol) Your found solution is elegant; I'll adopt it. nvm and rvm both have initializations have a decent perf hit, too.
At first I did the same as the author and just dumped the output from `pandoc --bash-completion` et al. into a file, but then I'd have to deal with cache invalidation on every machine that I use. Doing it manually isn't that bad, but remembering to update the file in a bunch of machines is a bit too much ugly for me.
After a surprisingly short Google session, I ended up settling with lazy initialization [1]. Unlike the post I found, I did it all manually, though. Now I just have this tucked at the end of my `.bashrc`:
[1]: https://dev.to/zanehannanau/bash-lazy-completion-evaluation-...