On Fri, 16 Sep 2011, ND wrote:
> Hi, Philip!
>
> Since PCRE 8.11 there is huge perfomance degradation at (?:...)*? and
> (?>...)*? constructs.
I think this is your fault :-) if I remember correctly. You reported a bug
and I fixed it. This is the ChangeLog entry for 8.13:
17. There was optimizing code for the last branch of non-capturing parentheses,
and also for the obeyed branch of a conditional subexpression, which used
tail recursion to cut down on stack usage. Unfortunately, now that there is
the possibility of (*THEN) occurring in these branches, tail recursion is
no longer possible because the return has to be checked for (*THEN). These
two optimizations have therefore been removed.
It is not sensible to check for (*THEN) at run-time every time a group
is entered. However, what I suppose I could do is to remember if (*THEN)
is used anywhere in the pattern. If it is not, the old code could be used
instead. I will see if this patch-up is possible.
Philip
--
Philip Hazel