Re: backquote peculiarities (was: Re: Combination of "eval set -- ..." and $() command substitution is slow)

2019-07-16 Thread Chet Ramey
On 7/15/19 6:19 PM, astian wrote: >> I doubt it makes any difference to the timing, which I think >> Chet has already answered, but it is worth pointing out that these >> two commands ... >> >> printf '%s\n' "`printf %s "$i"`" >> printf '%s\n' "$(printf

Re: Combination of "eval set -- ..." and $() command substitution is slow

2019-07-16 Thread Andreas Schwab
On Jul 16 2019, Ilkka Virta wrote: > On 15.7. 20:49, Robert Elz wrote: > >> printf '%s\n' "`printf %s "$i"`" >> printf '%s\n' "$(printf %s "$i")" >> >> aren't actually the same. In the first $i is unquoted, in the second it is >> quoted. > > Huh,

Re: Combination of "eval set -- ..." and $() command substitution is slow

2019-07-16 Thread Ilkka Virta
On 15.7. 20:49, Robert Elz wrote: printf '%s\n' "`printf %s "$i"`" printf '%s\n' "$(printf %s "$i")" aren't actually the same. In the first $i is unquoted, in the second it is quoted. Huh, really? It looks to me like the first one treats

backquote peculiarities (was: Re: Combination of "eval set -- ..." and $() command substitution is slow)

2019-07-15 Thread astian
Robert Elz: > Date:Wed, 10 Jul 2019 17:21:00 + > From:astian > Message-ID: > > I doubt it makes any difference to the timing, which I think > Chet has already answered, but it is worth pointing out that these > two commands ... > > printf

Re: Combination of "eval set -- ..." and $() command substitution is slow

2019-07-15 Thread Robert Elz
Date:Wed, 10 Jul 2019 17:21:00 + From:astian Message-ID: I doubt it makes any difference to the timing, which I think Chet has already answered, but it is worth pointing out that these two commands ... printf '%s\n' "`printf %s "$i"`"

Re: Combination of "eval set -- ..." and $() command substitution is slow

2019-07-15 Thread Chet Ramey
On 7/13/19 1:36 PM, astian wrote: > Chet Ramey: >>> - $() seems generally slightly slower than ``, but becomes >>> pathologically >>> so when preceded with "eval set -- ...". >> >> It is slightly slower -- POSIX requires that the shell parse the contents >> of $(...) to determine that

Re: Combination of "eval set -- ..." and $() command substitution is slow

2019-07-13 Thread astian
Dear Chet Ramey, thanks for the explanations, I assume you were able to reproduce the issue. First a warning that I forgot to include in the previous email: the quoted excerpts of the gprof tables correspond to a slightly modified test script in which I tried to magnify the overhead in order to

Re: Combination of "eval set -- ..." and $() command substitution is slow

2019-07-12 Thread Chet Ramey
On 7/10/19 1:21 PM, astian wrote: > Bash Version: 5.0 > Patch Level: 3 > Release Status: release > > Description: > > I discovered a curious performance degradation in the combined usage of the > constructs "eval set -- ..." and new-style command substitution. In short, > setting the

Combination of "eval set -- ..." and $() command substitution is slow

2019-07-10 Thread astian
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/tmp/bash/bash-5.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-parentheses -Wno-format-security uname output: