Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Performance tests of quoting and dequoting, printf -v turned out slow



On 10 marca 2018 at 16:03:11, Stephane Chazelas (stephane.chazelas@xxxxxxxxx) wrote:
> 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.

Before sending email I've created script.zsh with #!/usr/local/bin/zsh-5.3.1 shebang and pasted the code, it was still slow.

> What do you see, if you run:
>  
> (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:
>  
> type printf
> trap

"printf is a shell builtin"
<empty output>


> 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)?

Yes, it is still slow after /usr/local/bin/zsh-5.3.1 -f. I've recorded this: https://asciinema.org/a/X2T0PlE62gVh363c5oOZeckTz		

> --
> Stephane
>  

--  
Sebastian Gniazdowski
psprint /at/ zdharma.org



Messages sorted by: Reverse Date, Date, Thread, Author