From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10412 invoked by alias); 10 Feb 2016 13:15:48 -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: X-Seq: 21268 Received: (qmail 25474 invoked from network); 10 Feb 2016 13:15:46 -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,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=AVTsqo1ovPBm80upMVyxc8J5NVUzYpzAZCXQHxSkLro=; b=f+igSpujt3eMFy3/EPJWySGbRT7TaL+utOMNXATHCRIp1ygaSFa14lPpEDxgKwKpij gO+Cy+8hzV5JMRxUzFpr1d8UpWL0/jASr3WHMqL0AFOcSRpI7u1AtFC3eQeZrxHku7nU zgXKXnCGmgM1e+bv4WIxbf1zYlIhCos1lOv//xBd7YOB1xTQ79OEUIsrswDXKE1VjzbF 9xNK5R5NAIiRgmCLRAlviNuZBDWUFUW2m3mvCnxZ07BK2W2jG89eavU7qWJ2reSfuh3+ xdn1rmKup/ynNab04qB7VlwVb15dYfG3mWnzmzedZbVJT2LgG7LhbBHiLS9IqCJbJ4GI jnJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=AVTsqo1ovPBm80upMVyxc8J5NVUzYpzAZCXQHxSkLro=; b=fpiG/1SpAL4a13ueyCW4ZouMm0gGrCka67S3gw8jOgerL7PHOIGhBPE+/q6Z2HSaIn 6Fj9WaZ1DFMR6yudEA6JNRJcf8A8/gRHMFIOkjxvK1VR3hWTbW7oU4WOIl5/XQXrPm3n GOuZ7Xx2e2ttWPY9Q3JqimmnGsSm1NVWQkOkxOM4g5oWaxcjkK72zwAcQH3xlzB0phz5 2+FjZGEtM1TcTsx8cYHNsTL+TV+WrytwLtKm/CfezRmd/NAY+7p+taDz5XRGSHB9yhCZ 9ZGT63jHzmhclFAB8fSrfd/RKdkOO2gWzg/E63ZCt9iCBtpIF1SjNXVyOlCSafeut7Fq wzJQ== X-Gm-Message-State: AG10YOQM5Mt/BpI0r31adnJMX3ip++idFcqHcRUN6d8XWw1I7DP6nebj2RXvZcqDTZoxSvXkmge4w5tTLdy6Bw== X-Received: by 10.25.7.201 with SMTP id 192mr13275697lfh.107.1455110143866; Wed, 10 Feb 2016 05:15:43 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: Sebastian Gniazdowski Date: Wed, 10 Feb 2016 14:15:24 +0100 Message-ID: Subject: Re: New zplugin feature (was: Re: How completions work, do they require fpath?) To: Bart Schaefer Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Just to illustrate how ABS style programming (it's probably it) influences performance =E2=80=93 for the same 40 plugins antigen takes 4.90= 6 sec, instead of 0.668 sec. That's with zplugin's "debug" loading, with light loading (only autoload and compdef are then shadowed) it's 0.326 sec, the same for zgen (compinit called once). Best regards, Sebastian Gniazdowski On 10 February 2016 at 10:19, Sebastian Gniazdowski wrote: > Well, actually, antigen snippet I showed implements this too :D In > Advanced Bash Scripting Guide style (thus not fast), but still, they > do it. > > Best regards, > Sebastian Gniazdowski > > > On 10 February 2016 at 10:08, Sebastian Gniazdowski > wrote: >> On 31 January 2016 at 20:26, Bart Schaefer w= rote: >>> You could try this: Define your own "compdef" whose only action is >>> to cache its arguments somewhere. Load all the plugins, then after >>> compinit is run, play back the cached compdef arguments with the real >>> compdef. >> >> I realized how great that idea is. Implemented it in zplugin, thus an >> idiom is possible: >> >> source '/Users/sgniazdowski/.zplugin/bin/zplugin.zsh' >> zplugin load "some1/plugin1" >> zplugin load "some2/plugin2" >> ... >> zplugin load "some3/plugin3" >> autoload -Uz compinit >> compinit >> zplugin cdreplay -q # -q is quiet >> >> The difference between running compinit once and twice is huge, >> following time differences are possible: >> zsh -i -c exit 0,73s user 0,25s system 99% cpu 0,980 total >> zsh -i -c exit 0,11s user 0,04s system 97% cpu 0,156 total >> (for 3 plugins) >> zsh -i -c exit 1,24s user 0,41s system 99% cpu 1,667 total >> zsh -i -c exit 0,48s user 0,18s system 98% cpu 0,668 total >> (for 40 plugins) >> >> This is a very innovative, great thing. All current plugin managers >> drifted towards double compinit calling, by force of lack of >> shadowing: >> https://github.com/tarjoilija/zgen/blob/master/zgen.zsh#L471-L475 >> https://github.com/zsh-users/antigen/blob/master/antigen.zsh#L441-L462 >> >> OMZ slowness is I guess also result of this. >> >> Fun example: >> % unfunction compdef >> % zplg dtrace >> % compdef _ls cp >> % zplg dstop >> % zplg cdlist >> Recorded compdefs: >> compdef _ls cp >> % zplg cdreplay >> Compinit isn't loaded, cannot do compdef replay >> % autoload -Uz compinit >> % compinit >> % zplg cdreplay >> Running compdef _ls cp >> % echo $_comps[cp] >> _ls >> >> Best regards, >> Sebastian Gniazdowski