{"repo":"mroth/evalcache","free":true,"listed":false,"github":"https://github.com/mroth/evalcache","clone":"git clone https://github.com/mroth/evalcache.git","description":":hatching_chick: zsh plugin to cache eval loads to improve shell startup time","language":"Shell","stars":263,"topics":["zsh","zsh-plugin"],"license":"MIT","category":"cli-tools","readme_excerpt":"evalcache zsh plugin to cache the output of a binary initialization command, intended to help lower shell startup time. What it does There are lots of shell wrapper tools that follow the pattern of asking you to eval a specific init command in your shell startup, for example, rbenv asks: eval \"$(hub alias -s)\" While this is very convenient, the reality is there is a small amount of overhead associated with shelling out to this, and the output is almost always actually static in all of the tools I know. So why bear this cost every time you open a new tab in your shell? Instead, after you load this plugin, you can replace that same command with: evalcache hub alias -s The first time this runs, it will cache the output of the command to a file, which will be sourced in the future instead when it exists. If you update a tool and expect for some reason that it's initialization might have changed, you can simply clear the cache and it will be regenerated. It also gracefully degrades to a no-op if the tool is no longer installed. Benchmarks Some informal benchmarks from my MacBook on my .zshrc: command without first run subsequent runs savings ------------ ------: --------: --------------: ------: rbenv init 65ms 65ms 8ms 88% hub alias 30ms 30ms 6ms 80% scmpuff init 24ms 25ms 10ms 58% The difference isn't huge, but can be handy in shaving down shell startup time, especially if you use a bunch of these tools. Every millisecond counts! Options - $ZSH EVALCACHE DIR : cache files storag","default_branch":null,"files":null,"tree":[],"storefront":"/r/mroth","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mroth/evalcache/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}