Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash Extglob模式匹配表达式“${a/+;([0-9])/};指数慢_Bash - Fatal编程技术网

Bash Extglob模式匹配表达式“${a/+;([0-9])/};指数慢

Bash Extglob模式匹配表达式“${a/+;([0-9])/};指数慢,bash,Bash,试试这个(bashv4.4): …并在速度变慢时键入Control-C几次。每次字符串长度加倍时,处理时间约为10倍。在我的系统上,$c大约需要10秒才能变成383个字符长 这是一个错误吗?这会更快:a=3.14;虽然真实;执行a=“$a$a”;时间sed的//[0-9]*\.//g'与Echoo的IO无关。它看起来像extglob在处理大字符串时速度明显减慢。@No;删除echo$c仍然会导致非线性减速。bash不是为了速度而构建的 a=3.14 ; while true ; do a="$a

试试这个(
bash
v4.4):

…并在速度变慢时键入Control-C几次。每次字符串长度加倍时,处理时间约为10倍。在我的系统上,
$c
大约需要10秒才能变成383个字符长


这是一个错误吗?

这会更快:
a=3.14;虽然真实;执行a=“$a$a”;时间sed的//[0-9]*\.//g'与Echoo的IO无关。它看起来像
extglob
在处理大字符串时速度明显减慢。@No;删除echo$c仍然会导致非线性减速。bash不是为了速度而构建的
a=3.14 ; while true ; do a="$a $a" ; time c="${a//+([0-9])./}" ; echo ${#c} ; done