[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Very slow pattern substitution in parameter expansion
From: |
Dan Douglas |
Subject: |
Re: Very slow pattern substitution in parameter expansion |
Date: |
Tue, 09 Apr 2013 23:15:11 -0500 |
User-agent: |
KMail/4.8.3 (Linux/3.4.6-pf+; KDE/4.8.3; x86_64; ; ) |
On Tuesday, April 09, 2013 10:23:34 PM Chet Ramey wrote:
> On 4/9/13 9:56 PM, Dan Douglas wrote:
> > Erm, here it is in a less unreadable format:
>
> It is pretty slow. You forgot to enable `extglob'.
D'oh!
Bad algorithm? I suppose it's lots of backtracking and maybe has to test every
substring for every position in the string. In my version it took about .3 of
a sec, but combining all that into one string with x=${a[*]}, doing the same
on x took about 10 seconds. It's still 0.00 in ksh/zsh.
--
Dan Douglas