Re: [pcre-dev] JIT speed tests

Αρχική Σελίδα
Delete this message
Συντάκτης: Zoltán Herczeg
Ημερομηνία:  
Προς: ND
Υ/ο: Pcre-dev
Αντικείμενο: Re: [pcre-dev] JIT speed tests
This is an exponential case for the code generator. It is similar to the one which is sent by Ralf recently.

In PCRE, if P is not a character literal or a backreference, (P){n,m} is expanded to

(P)(P)(P)...(P)(?:(P)(?:(P)....)?)?

The code generator optimize these patterns one-by-one, and this process requires a lot of time and an enormous stack space. Where do you use such pattern? Can't you use a better pattern?

Ahead-of-time (AOT) compilation is not really useful in my experiences, because pointers are not known at compile time, and you need to replace them by costly memory reads and writes. If you really prefer AOT, I would suggest other tools, such as lex/flex/ etc. which generates C code.

Regards,
Zoltan

ND <nadenj@???> írta:
>Hi, Zoltan!>
>

I'm start testing JIT and meets two problems:>
>
>

1. here is pcretest listing>
>

PCRE version 8.33-RC1 2012-12-07>
>

/((((((((((\w{4}aa){4}aa){4}aa){3}aa){4}aa){2}aa){4}aa){3}aa){3}aa){11}aa){3}aa/imsxS+>
Compile time 4.0000 milliseconds>
Study time 4637.0000 milliseconds>
01234567890123456789012345678901234567890123456789012345678901234567890123456789.>
Execute time 0.0000 milliseconds>
No match>
>

Study time is 4 seconds!!! Wow! It's enormous large!>
Is there a way to optimize?>
>
>

2. Since JIT study time is so large, why there is no possibility to precompile JIT data? Precompiling may be excellent way to expand JIT's sphere of application.>
>

Regards>
>

-- >
## List details at https://lists.exim.org/mailman/listinfo/pcre-dev >