some extended Korn shell globs are really slow
Attaching a testcase.
The first glob is decently fast, the second one is noticeable (about a second) on a 3 GHz Athlon.
The third glob needs to be killed with SIGKILL out of all things.
Also, I have another shell script, where replacing
[[ $foo = *@(x)* ]] with [[ $foo = *'x'* ]] and
[[ $foo = @(1|2………),* ]] with [[ $foo = 1,* || $foo = 2………,* ]
made it noticeable faster.
The probable culprit is gmatchx, do_gmatch, and friends, mostly from misc.c.
This bug serves as documentation for now, because I have no idea how to tackle it, but if someone takes it up and submits patches, be my guest.