function source () {local __before="$EPOCHREALTIME"builtin source "$@"local __after="$EPOCHREALTIME"local __ms="$(( (__after - __before) * 1000 ))"echo "$__ms $@" >>| /tmp/zprezto-bench.$$.txt}
$ rm -f /tmp/zprez* ; zsh -il -c exit; cat /tmp/zprez* | sort -rn | head1638284631932.147 /Users/zachriggle/.zprezto/modules/zsh-z/init.zsh119.97294425964355 /Users/zachriggle/.zprezto/modules/redacted1/init.zsh85.247993469238281 /Users/zachriggle/.zprezto/modules/zach-riggle/init.zsh47.258853912353516 /Users/zachriggle/.zprezto/modules/completion/init.zsh30.105113983154297 /Users/zachriggle/.zprezto/modules/prompt/init.zsh23.977041244506836 /Users/zachriggle/.zprezto/modules/redacted2/scripts/init.zsh20.226001739501953 /Users/zachriggle/.zprezto/modules/zach-riggle/path.zsh19.911050796508789 /Users/zachriggle/.zprezto/modules/syntax-highlighting/init.zsh19.558191299438477 /Users/zachriggle/.zprezto/modules/syntax-highlighting/external/zsh-syntax-highlighting.zsh
On Tue, Nov 30, 2021 at 12:49 PM Zach Riggle <zachriggle@xxxxxxxxx> wrote:
>
> > FWIW, I zcompile my own rc files
>
> What is the optimal way to compile a huge set of them?
Most of the zsh files you are using are *installed* rather than
modified by yourself. You can zcompile them when you install/update
them. E.g., you have some code that installs/updates prezto. Invoke
zcompile in there.
There are also zsh startup files that you modify manually every now
and then (.zshrc, etc.). Compiling these files is harder and is more
likely to cause issues. On the other hand, the benefits of compiling
them are tiny, simply because those files are tiny. Once again, you
can manually zcompile different things and check whether you notice
any difference. If you don't, there is no need to invest in
zcompiling.
If first_prompt_lag of your shell is 600ms, zcompiling won't have
noticeable effects. You'll need to optimize other things first for
zcompiling to matter.
Roman.