Martin,
On Wed, Apr 14, 2010 at 4:25 AM, Martin Holst Swende wrote:
> Hi,
>
> I noticed that some greppers took extremely long time to run for certain
> input, especially two of them almost appeared to halt when I ran them.
> Those were ajax and svnusers. In ajax.py, the following regexp is used
Hi,
.*? is a "lazy" match, whereas .* is a "greedy" match. The lazy one will
match as small a string as possible, thus it has to back track a LOT.
Getting rid of these is going to help a lot. (It's pleasantly confusing that
the lazy match is more expensive. :-))
Tom Conner
On Wed, Apr 14, 2010 a
Hi,
I noticed that some greppers took extremely long time to run for certain
input, especially two of them almost appeared to halt when I ran them.
Those were ajax and svnusers. In ajax.py, the following regexp is used :
regex_string = '< *?script.*?>.*?'
regex_string +=
'(XMLHttp