From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6396 invoked by alias); 17 Jun 2017 17:25:47 -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: 22734 Received: (qmail 4523 invoked from network); 17 Jun 2017 17:25:47 -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.114914 secs); 17 Jun 2017 17:25:47 -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 (16) Date: Sat, 17 Jun 2017 19:25:33 +0200 From: Sebastian Gniazdowski To: Bart Schaefer , Zsh Users Message-ID: In-Reply-To: <170617093919.ZM990@torch.brasslantern.com> References: <170617093919.ZM990@torch.brasslantern.com> Subject: Re: Why sourcing a file is not faster than doing a loop with eval, zle -N X-Mailer: Airmail (442) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 17 Jun 2017 at 18:39:55, Bart Schaefer (schaefer=40brasslantern.com) w= rote: > On Jun 17, 5:44pm, Sebastian Gniazdowski wrote: > =7D > =7D So the gain from zcompiled .fsh=5Fcache seems to be maximal. > =20 > As long as you've got a good way to test these timings ... compile > your .fsh=5Fcache file with =22zcompile -R=22 and see if you still get > any speedup=3F > =20 > Some simple tests that I did seem to indicate that zcompile does > not do much good if the default =22zcompile -M=22 behavior is disabled.= > =20 No problem.=C2=A0The results seem the same, best =22zcompile=22 time (pre= viously reported): 0.375 s, best =22zcompile -R=22: 0.376 s. Did this twi= ce after anxiety that I forgot =22-R=22 (very unlikely): 0.374 s. BTW, I have a whacky idea: 1. Invoke =22source=5Fprepare =7E/.plugins/aplugin.plugin.zsh.zwc=22, etc= . for all used plugins 2. Continue with normal zshrc 3. After it, invoke source=5Fload with the same paths 4. source=5Fprepare will use threads to load .zwc files 5. There will be internal hash table mapping paths to Eprogs, mutexes 6. If the Eprog is not yet ready, source=5Fload will hang on mutex This is to: perform normal zshrc execution while loading of bytecode in b= ackground. I checked that =7E/.fsh=5Fcache.zwc is 158 kB in size, quite m= uch. But all this is probably a lost game, the mutex use, thread creation= , will waste the gain. Although a cool thing to code, I think I will do i= t anyway. -- =20 Sebastian Gniazdowski psprint /at/ zdharma.org