From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114 invoked by alias); 3 Jun 2017 14:11:25 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41204 Received: (qmail 29837 invoked from network); 3 Jun 2017 14:11:25 -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(0.0/5.0):. Processed in 2.171338 secs); 03 Jun 2017 14:11:25 -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=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: psprint@zdharma.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at zdharma.org does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new using ClamAV (17) Date: Sat, 3 Jun 2017 16:11:12 +0200 From: Sebastian Gniazdowski To: Bart Schaefer , zsh-workers@zsh.org Message-ID: Subject: Re: Improving zcompdump (Re: A patch with hashtable optimization, which doesn't work) X-Mailer: Airmail (231) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 20 maja 2017 at 19:08:09, Bart Schaefer (schaefer=40brasslantern.com) = wrote: > =7D Tried to optimize mkautofn, to speed up sourcing zcompdump. > > How much does zcompdump actually help=3F Have you compared startup with= > and without it=3F > > There's a bunch of stuff in .zcompdump. Have you investigated whether > certain parts of it are slower than others=3F > > One lesson learned with Completion/Base/Utility/=5Fstore=5Fcache is tha= t > parsing array assignments is expensive. I've wrapped sourcing zcompdump in compinit this way: =C2=A0 =C2=A0 =C2=A0 zmodload zsh/zprof =C2=A0 =C2=A0 =C2=A0 () =7B =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 builtin . =22=24=5Fcomp=5Fdumpfile=22 =C2=A0 =C2=A0 =C2=A0 =7D =C2=A0 =C2=A0 =C2=A0 zprof =7C head -n 14 Then I tried with a) normal .zcompdump, and b) with modification =E2=80=93= with =5Fcomps=3D( ), i.e. empty. Results seem to confirm what you said: num =C2=A0calls =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ti= me =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 self =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0name -------------------------------------------------------------------------= ---------- =C2=A01) =C2=A0 =C2=A01 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A058,93 =C2=A0 =C2= =A058,93 =C2=A0100,00% =C2=A0 =C2=A0 58,93 =C2=A0 =C2=A058,93 =C2=A0100,0= 0% =C2=A0(anon) vs. =C2=A01) =C2=A0 =C2=A01 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A012,81 =C2=A0 =C2= =A012,81 =C2=A0100,00% =C2=A0 =C2=A0 12,81 =C2=A0 =C2=A012,81 =C2=A0100,0= 0% =C2=A0(anon) There's 58-12=3D46 ms to win, a significant value when thinking in terms = of instant Zsh startup, which today is rather a melody of the past, with = zsh-syntax-highlighting and zsh-autosuggestions overloading all =24widget= s entries during startup, in a loop. I would go in direction of implementing new trivial parser that would rea= d key-value pairs and put them to hash. It might even predict required si= ze for 1562 =5Fcomps elements in the hash (it's x4 A=46AIR, saw in addhas= hnode2), so that no expandhashtable() will be called. There would be .zco= mpdump=5Fcomps file with the pairs. Nothing will break, old .zcompdump wi= ll work. -- Sebastian Gniazdowski psprint /at/ zdharma.org