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 9 marca 2018 at 14:23:44, Stephane Chazelas (stephane.chazelas@xxxxxxxxx) wrote:
> I can't reproduce with zsh 5.4.2 (x86_64-debian-linux-gnu)
> compared with 4.4.18(1)-release (x86_64-pc-linux-gnu).
> in a en_GB.UTF-8 locale.
>  
> FWIW, I find:
>  
> $ time INPUT='ice as"program" pick"$ZPFX/bin/prll_(qer|bfr)" src"prll.sh" make"install  
> PREFIX=$ZPFX"' bash -c 'for ((i = 0; i < 50000; i++)); do printf -v OUTPUT %q "$INPUT";  
> done'
> INPUT= bash -c 1.48s user 0.00s system 99% cpu 1.485 total
> $ time INPUT='ice as"program" pick"$ZPFX/bin/prll_(qer|bfr)" src"prll.sh" make"install  
> PREFIX=$ZPFX"' zsh -c 'for ((i = 0; i < 50000; i++)); do printf -v OUTPUT %q "$INPUT"; done'  
> INPUT= zsh -c 0.83s user 0.14s system 99% cpu 0.979 total
>  
> What's your version and locale?

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.

-- 
Sebastian Gniazdowski
psprint /at/ zdharma.org




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