From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16654 invoked by alias); 10 Mar 2018 08:37:00 -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: 42440 Received: (qmail 14189 invoked by uid 1010); 10 Mar 2018 08:37:00 -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 13.532159 secs); 10 Mar 2018 08:37:00 -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 (9) Date: Sat, 10 Mar 2018 09:36:42 +0100 From: Sebastian Gniazdowski To: Stephane Chazelas Cc: Zsh hackers list Message-ID: In-Reply-To: <20180309145352.GB20986@chaz.gmail.com> 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: 7bit Content-Disposition: inline On 9 marca 2018 at 15:53:52, Stephane Chazelas (stephane.chazelas@gmail.com) wrote: > 2018-03-09 14:39:10 +0100, Sebastian Gniazdowski: > [...] > > 5.3.1, I looked also at 5.4.2 and the results were the same. > > For your snippets I get the same results as you. If I source > > short.zsh, I again get ~25 sec time. I will find some time to > > narrow this shortly. > [...] > > Maybe a heavy (that forks for instance) "DEBUG" trap? > > or a wrapper function around "printf"? I only changed method of time measurement in your snippet, and obtained the slowness: % typeset -F3 SECONDS=0; INPUT='ice as"program" pick"$ZPFX/bin/prll_(qer|bfr)" src"prll.sh" make"install PREFIX=$ZPFX"'; for ((i = 0; i < 50000; i++)); do printf -v OUTPUT '%q' "$INPUT"; done; echo $SECONDS 151.137 Not sure what using `time' instead of $SECONDS does, but above method is less suspected of any side effects. -- Sebastian Gniazdowski psprint /at/ zdharma.org