Re: [pcre-dev] AllAny* is slow with JIT

Pàgina inicial
Delete this message
Autor: ph10
Data:  
A: ND
CC: Pcre-dev
Assumpte: Re: [pcre-dev] AllAny* is slow with JIT
On Sat, 25 May 2019, ND via Pcre-dev wrote:

> Here is output.txt (capture is excluded):
>
> PCRE2 version 10.33 2019-04-16
> /a.*/s
> a\[0123456789]{200000}
> Match time 0.0010 milliseconds
>
> /a.*/s,jit
> a\[0123456789]{200000}
> Match time 1.2800 milliseconds
>
>
> We can see that JIT-version is about 1000 times slower. Moreover, non-JIT
> version time don't depend from subject length. But JIT-version is. That's why
> larger subject cause slower match.


I have reproduced this effect. The non-JIT code is optimized for this
case, doing an immediate jump to the end of the subject after matching
"a", which is why it is not length dependent.

The JIT maintainer will no doubt comment on the JIT case - it does seem
to apply only to PCRE2, not PCRE1.

Philip

--
Philip Hazel