Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Performance tests of quoting and dequoting, printf -v turned out slow
- X-seq: zsh-workers 42441
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>
- Subject: Re: Performance tests of quoting and dequoting, printf -v turned out slow
- Date: Sat, 10 Mar 2018 15:03:11 +0000
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=07/TMMaoXOqBVdec8HISPGCN0Q2zCP4eFBXBn75pR8Y=; b=Yu1JepKQj4gfxeVkM7idQCdcdGCVMvRoyvZRgbMVT4UbO0aS4DHnyuLluz/UVXKjXB ES1QEsfNyHcKml3/1yZEzjAhuqBolanQeAk8lWmrcXQEbI0zZp0cytI5qpi/ExY3zrer VQ10ioaZbXQ6mxf02DZG6zn25fW6WlESu5qeK6GProAzWgkw3XAQu5hFpb1vjbxlGl0C BU6QK9KFRNkHjIdo/9/Cbn/59LB4BRdu6ayHFOcxsvNjGG47/b2WmJcC1zMbPJfUPHfg 7emnZN+7l5l81h8ycOec4ptFnFfuQtdXEoqznyLdesRXSa8qBeGuWawVkBMN20cm5tmG OZmg==
- In-reply-to: <etPan.5aa3991a.596633ab.159ee@zdharma.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <etPan.5aa22836.70671812.159ee@zdharma.org> <etPan.5aa28b1e.77e79f33.159ee@AirmailxGenerated.am> <etPan.5aa28e7e.6288ff7f.159ee@zdharma.org> <20180309145352.GB20986@chaz.gmail.com> <etPan.5aa3991a.596633ab.159ee@zdharma.org>
2018-03-10 09:36:42 +0100, Sebastian Gniazdowski:
[...]
> 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.
[...]
More importantly here, the difference is that you have that code
interpreted by your interactive shell that has read your
~/.zshrc, while the "time" version starts a new non-interactive
shell that doesn't read ~/.zshrc to interpret the code.
There is probably something in your interactive shell
environment that is causing that.
What do you see, if you run:
(set -x; repeat 5 printf -v x x)
What's the output of:
type printf
trap
Do you get the same behaviour if you run that same code after
"zsh -f" (a new interactive shell instance that doesn't read
your ~/.zshrc)?
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author