Re: [pcre-dev] JIT have very limited applicability

Top Pagina
Delete this message
Auteur: Zoltán Herczeg
Datum:  
Aan: ND
CC: Pcre-dev
Onderwerp: Re: [pcre-dev] JIT have very limited applicability
Hi,

JIT is typically used by server applications such as NGNIX webserver, Suricata Intrusion Detection System, ModSecurity firewall, etc. and it seems they are happy with it. Some Korean guys made a paper about integrating JIT into Snort: http://kiise.or.kr/e_journal/2013/4/CST/pdf/01.pdf They also have the same conclusion as yours: JIT compilation has a considerable overhead, but since server applications are rarely restarted, this is not an issue. You can also use a deferred compilation in a second thread if server startup time is important (and use the interpreter if a pattern is not yet compiled).

The other typical use case is searching a single pattern in a huge input, such as GNU grep, ag (silver searcher), etc.

In short JIT only helps if you compile a pattern once, and use it several times. It is inefficient for searching a pattern once in a small string like checking a version string.

I don't understand this: "pattern is reused many times in a row in VM, without use of other
patterns between". Why other patterns can not be used?

Regards,
Zoltan

ND <nadenj@???> írta:
>>

Good day!>
>
>

As I trying to say some time ago, PCRE-JIT in most applications is >
useless. It only slowing matching process.>
>

Consider timings. In most real situations JIT compile+run time greatly >
exceeds interpreter compile+run time.>
Taking this into account there are very few circumstances when JIT brings >
benefits to user:>
- JIT compile+run time is less then interpreter run time (I think that >
number of this cases is about a zero);>
- pattern is reused many times in a row in VM, without use of other >
patterns between (IMHO number of this cases is also about a zero).>
>

So JIT without ability to use JIT-precompiled patterns have a ve-e-e-ry >
limited applicability.>
May be I'm err. Correct me please if so.>
>

I propose add to JIT ability of saving JIT-compiled data. So full >
precompiled pattern can be used by main application. This eliminates a JIT >
compile time costs and allow to use a speed benefits of JIT in most cases.>
I understand than compiled JIT-data saved on one platform probably can't >
be used on other platforms. But it can be used by application then starts >
on one platform with great effectiveness.>
>
>

I take this opportunity to thank Phillip and Zoltan for large efforts and >
great product.>
Best regards.>
>

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