bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Very slow pattern substitution in parameter expansion


From: admin
Subject: Very slow pattern substitution in parameter expansion
Date: Tue, 9 Apr 2013 22:53:00 +0200

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-p$
uname output: Linux colm.tk 3.5.0-21-generic #32-Ubuntu SMP Tue Dec 11
18:51:59 UTC 2012 x86_64 x86_64 x86_64 GNU/$
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.2
Patch Level: 37
Release Status: release

Description:
        A particular pattern substitution as in
        ${parameter//pattern/string}
        is very very slow.
                        
Repeat-By:
a="curl --header 'Host: v33.veehd.com' --header 'User-Agent:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101
Firefox/19.0' --header 'Accept: 
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header 
'Accept-Language: en-US,en;q=0.5'
--header 'Accept-Encoding: gzip, deflate' --header 'Referer:
http://veehd.com/vpi?h=NDcwNjgyNXw0ODB8ODQ2Ljh8ZGl2eHwzfDUwMDB8MTM2NTUzNzQ1OHwxNTJ8MXw0NTNmOTA3NDY1Yjg3ZmM5MjI0MTI$
--header 'Cookie: __utma=163375675.149191626.1365449922.1365465732.1365537650.4;
__utmz=163375675.1365465732.3.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided);
__utmb=163375675.1.10.1365537650; __utmc=163375675' --header 'Connection: 
keep-alive'
'http://v33.veehd.com/dl/45c2f8a516118e29917ff154fee0179e/1365544663/5000.4706825.avi&b=390'
-o '4706825.avi' -L"
time echo ${a//[0-9]/z}
real    0m0.004s
user    0m0.004s
sys     0m0.000s
time echo ${a//+([0-9])/z}
real    1m21.187s
user    1m20.293s
sys     0m0.264s



reply via email to

[Prev in Thread] Current Thread [Next in Thread]