From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25166 invoked by alias); 10 Mar 2018 16:53:32 -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: List-Unsubscribe: X-Seq: 42442 Received: (qmail 14714 invoked by uid 1010); 10 Mar 2018 16:53:32 -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 4.254829 secs); 10 Mar 2018 16:53:32 -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 (18) Date: Sat, 10 Mar 2018 17:53:22 +0100 From: Sebastian Gniazdowski To: Stephane Chazelas Cc: Zsh hackers list Message-ID: In-Reply-To: References: <20180309145352.GB20986@chaz.gmail.com> Subject: Re: Performance tests of quoting and dequoting, printf -v turned out slow X-Mailer: Airmail (467) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 10 marca 2018 at 16:03:11, Stephane Chazelas (stephane.chazelas=40gmai= l.com) wrote: > More importantly here, the difference is that you have that code > interpreted by your interactive shell that has read your > =7E/.zshrc, while the =22time=22 version starts a new non-interactive > shell that doesn't read =7E/.zshrc to interpret the code. > =20 > There is probably something in your interactive shell > environment that is causing that. Before sending email I've created script.zsh with =23=21/usr/local/bin/zs= h-5.3.1 shebang and pasted the code, it was still slow. > What do you see, if you run: > =20 > (set -x; repeat 5 printf -v x x) % (set -x; repeat 5 printf -v x x) +/usr/local/bin/zsh-5.3.1-dev-0:130> printf -v x x +/usr/local/bin/zsh-5.3.1-dev-0:130> printf -v x x +/usr/local/bin/zsh-5.3.1-dev-0:130> printf -v x x +/usr/local/bin/zsh-5.3.1-dev-0:130> printf -v x x +/usr/local/bin/zsh-5.3.1-dev-0:130> printf -v x x > What's the output of: > =20 > type printf > trap =22printf is a shell builtin=22 > Do you get the same behaviour if you run that same code after > =22zsh -f=22 (a new interactive shell instance that doesn't read > your =7E/.zshrc)=3F Yes, it is still slow after /usr/local/bin/zsh-5.3.1 -f. I've recorded th= is:=C2=A0https://asciinema.org/a/X2T0PlE62gVh363c5oOZeckTz =09 > -- > Stephane > =20 -- =20 Sebastian Gniazdowski psprint /at/ zdharma.org