zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint@zdharma.org>
To: Zsh Users <zsh-users@zsh.org>
Subject: New Zplugin feature to increase startup time by 33%
Date: Mon, 27 Nov 2017 15:49:24 +0100	[thread overview]
Message-ID: <etPan.5a1c25f4.7f5d6171.c73c@zdharma.org> (raw)

Hello,
consider following code:

  zplugin ice wait'[[ ${ZLAST_COMMANDS[(r)cras*]} ]]'
  zplugin light zdharma/zplugin-crasis

The package zplugin-crasis is not loaded after those commands. Zsh startup continues fast.

But when user enters "cras" on command line, then instantly the plugin is loaded and command "crasis" becomes available. See the feature in action:

  https://asciinema.org/a/149725

One can also do wait'1' – 1 second delay.

I load 11 plugins, with wait'1' zsh startup time is 160 ms, normal loading is 240 ms – that is 33% difference.

It is like Windows showing desktop at startup but still loading in background. Except here there are no lags, command line is fully usable.

ZLAST_COMMANDS is built by my zdharma/fast-syntax-highlighting so it is required, but if Daniel agrees I will submit patch to zsh-syntax-highlighting. Z-sy-h processing loop tracks which token is at command position, it already has needed information to fill ZLAST_COMMANDS. A dedicated plugin is on the way, to not limit users to syntax-colored setups.

--  
Sebastian Gniazdowski
psprint /at/ zdharma.org


                 reply	other threads:[~2017-11-27 14:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=etPan.5a1c25f4.7f5d6171.c73c@zdharma.org \
    --to=psprint@zdharma.org \
    --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).