For my local dotfiles I have this snippet at the end of my .zshrc:
for f in ~/.zshrc ~/.zshenv ; do
[ "${f}"(:A) -ot "$f".zwc ] || zcompile "$f"
done
This ensures that these scripts are always precompiled if modified.
But global scripts that I source are much more heavy-weight, for example /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh, /usr/share/doc/fzf/examples/completion.zsh or /usr/share/doc/fzf/examples/key-bindings.zsh.
Is there a good solution how to zcompile these, ideally globally for all users? Or should I just resort to copy them locally into my $HOME and zcompile there?