zsh-users
 help / color / mirror / code / Atom feed
* New Zplugin feature to increase startup time by 33%
@ 2017-11-27 14:49 Sebastian Gniazdowski
  0 siblings, 0 replies; only message in thread
From: Sebastian Gniazdowski @ 2017-11-27 14:49 UTC (permalink / raw)
  To: Zsh Users

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-27 14:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27 14:49 New Zplugin feature to increase startup time by 33% Sebastian Gniazdowski

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).