ae3e71cb84
At least until Zsh version 5.7.1, no performance improvement is observed out of using those. In some cases, the performance is even worsened, like when using autoload -w functions_digest.zwc instead of autoload func_name1 func_name2 ...
25 lines
705 B
Text
25 lines
705 B
Text
() {
|
|
setopt LOCAL_OPTIONS CASE_GLOB EXTENDED_GLOB
|
|
autoload -Uz zrecompile
|
|
local zdumpfile zfile
|
|
|
|
# Compile the completion cache; significant speedup
|
|
zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile=<%= home %>/.zcompdump
|
|
if [[ -f ${zdumpfile} ]]; then
|
|
zrecompile -p ${1} ${zdumpfile} || return 1
|
|
fi
|
|
|
|
# Compile Zsh startup files
|
|
for zfile in ${1} <%= home %>/<%= startup_files_glob %>(N-.); do
|
|
zrecompile -p ${1} ${zfile} || return 1
|
|
done
|
|
|
|
# Compile Zim scripts
|
|
for zfile in ${ZIM_HOME}/(^*test*/)#*.zsh(|-theme)(N-.); do
|
|
zrecompile -p ${1} ${zfile} || return 1
|
|
done
|
|
|
|
if [[ ${1} != -q ]]; then
|
|
print -P '<%= done %>Done with compile.'
|
|
fi
|
|
} "${@}"
|