On Thu, Jul 20, 2023 at 11:54 AM Chet Ramey <chet.ra...@case.edu> wrote: > So I'll go ahead with your patch, starting with the globbing changes.
Thanks! BTW, changing quote_string_for_globbing to skip escaping characters that don't need it makes globbing >2x faster in the case that most of the pattern is a quoted string. This patch only skips over non-ASCII characters (because that's all that was needed for the normalization to work) but I wonder if you'd be interested in changes to the function that would skip escaping ASCII characters that aren't glob-special as well. I _think_ it would just be a slight variation of the code that already does this for regexes but I haven't thought about the edge cases carefully yet. mkdir /tmp/new && cd /tmp/new touch {0001..1000} printf -v str %1000s; export str=${str// /π} export TIMEFORMAT=%3lR bash-devel -c 'time for i in {1..100}; { : "$str"*; }' 0m5.549s bash-devel -c 'time for i in {1..100}; { : $str*; }' 0m1.936s bash-patch -c 'time for i in {1..100}; { : "$str"*; }' 0m1.948s bash-patch -c 'time for i in {1..100}; { : $str*; }' 0m1.926s