agkozak/zsh-z

compinit takes ~2s

tmplt opened this issue · 2 comments

tmplt commented

With zsh 5.7.1 (x86_64-pc-linux-gnu) zsh takes ~2s to source a ~/.zshrc containing

source "/path/to/zsh-z/zsh-z.plugin.zsh"
autoload -U compinit && compinit

No framework is used and ~/.z contains two lines.

On my Ubuntu laptop, if I reduce my .zshrc to

typeset -F SECONDS=0
source '/path/to/zsh-z/zsh-z.plugin.zsh'
autoload -U compinit && compinit
echo "Loaded in ${$(( SECONDS * 1000 ))%.*}ms."

it loads in about 300ms.

I'd like to help you, but I'll probably need to know more about your system. Plus, check to see if you have a .zshenv or a .zprofile -- those could be loading something, too.

tmplt commented

I'm using NixOS, and had forgotten about the programs.zsh.enableCompletion = true in my system configuration which adds a autoload -U compinit && compinit to the system-wise zshrc unless enableGlobalCompInit = false. An oversight on my part; pardon the noise.