Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
New Zplugin feature to increase startup time by 33%
- X-seq: zsh-users 22991
- From: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: New Zplugin feature to increase startup time by 33%
- Date: Mon, 27 Nov 2017 15:49:24 +0100
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author