From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27964 invoked by alias); 27 Nov 2017 14:49:30 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 22991 Received: (qmail 25392 invoked by uid 1010); 27 Nov 2017 14:49:30 -0000 X-Qmail-Scanner-Diagnostics: from aok120.rev.netart.pl by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(85.128.245.120):SA:0(-1.9/5.0):. Processed in 2.374951 secs); 27 Nov 2017 14:49:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: psprint@zdharma.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Virus-Scanned: by amavisd-new using ClamAV (10) Date: Mon, 27 Nov 2017 15:49:24 +0100 From: Sebastian Gniazdowski To: Zsh Users Message-ID: Subject: New Zplugin feature to increase startup time by 33% X-Mailer: Airmail (442) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, consider following code: =C2=A0 zplugin ice wait'=5B=5B =24=7BZLAST=5FCOMMANDS=5B(r)cras*=5D=7D =5D= =5D' =C2=A0 zplugin light zdharma/zplugin-crasis The package zplugin-crasis is not loaded after those commands. Zsh startu= p continues fast. But when user enters =22cras=22 on command line, then instantly the plugi= n is loaded and command =22crasis=22 becomes available. See the feature i= n action: =C2=A0 https://asciinema.org/a/149725 One can also do wait'1' =E2=80=93 1 second delay. I load 11 plugins, with wait'1' zsh startup time is 160 ms, normal loadin= g is 240 ms =E2=80=93 that is 33% difference. It is like Windows showing desktop at startup but still loading in backgr= ound. Except here there are no lags, command line is fully usable. ZLAST=5FCOMMANDS is built by my zdharma/fast-syntax-highlighting so it is= required, but if Daniel agrees I will submit patch to zsh-syntax-highlig= hting. Z-sy-h processing loop tracks which token is at command position, = it already has needed information to fill ZLAST=5FCOMMANDS. A dedicated p= lugin is on the way, to not limit users to syntax-colored setups. -- =20 Sebastian Gniazdowski psprint /at/ zdharma.org