zsh-users
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: "Peter Slížik" <peter.slizik@gmail.com>
Cc: Zsh-Users List <zsh-users@zsh.org>
Subject: Re: Adding a completion file has created a delay in ZSH startup time
Date: Wed, 29 Sep 2021 11:54:04 +0200	[thread overview]
Message-ID: <CAN=4vMqCe2B_f4MvJgyJ_MteB0o5fpbUXX5YkV-U+kFkoqm=ZQ@mail.gmail.com> (raw)
In-Reply-To: <CAC-uhUD1ov=_ukH0S+3g7HQz6EMEG1sh7HU_2B+zzjVgiwQuwQ@mail.gmail.com>

On Wed, Sep 29, 2021 at 11:45 AM Peter Slížik <peter.slizik@gmail.com> wrote:
>
> Hello,
>
> I've added ~/.zsh/completions to fpath:
>
> fpath=(~/.zsh/autoload ~/.zsh/completions $fpath)
>
> this seemingly simple change has added 1 or 2 seconds to ZSH start time.

This usually happens when compinit is invoked before and after you
modify fpath. The biggest offender here is Ubuntu. Its global zshrc
has this awfulness:

    # If you don't want compinit called here, place the line
    # skip_global_compinit=1
    # in your $ZDOTDIR/.zshenv
    if grep -q '^ID.*=.*ubuntu' /etc/os-release && [[ -z
"$skip_global_compinit" ]]; then
     autoload -U compinit
     compinit
    fi

The solution is to add skip_global_compinit=1 to ~/.zshenv.

Naturally, you also need to ensure that your own rc files invoke
compinit only once, after all changes to fpath.

Roman.


      reply	other threads:[~2021-09-29  9:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29  9:43 Peter Slížik
2021-09-29  9:54 ` Roman Perepelitsa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN=4vMqCe2B_f4MvJgyJ_MteB0o5fpbUXX5YkV-U+kFkoqm=ZQ@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=peter.slizik@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).