[pcre-dev] Announcing partial matching in JIT

Kezdőlap
Üzenet törlése
Szerző: Zoltán Herczeg
Dátum:  
Címzett: pcre-dev
Tárgy: [pcre-dev] Announcing partial matching in JIT
Hi All,

partial matching is added to PCRE-JIT, all tests are passed. We also identified some issues with the main library which will be fixed as a separate works. The current implementation is bug compatible with PCRE.

To use partial matching in JIT, you need to compile its corresponding machine code first, so new flags PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE, PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE) were added to pcre_study.

For example, if PCRE_STUDY_JIT_COMPILE and PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE are passed to pcre_study, the compiler runs twice, and two machine functions are generated (so the consumed machine code space is also doubled). One for normal matching, and one for partial hard matching. The partial soft mode is still handled by the interpreter in this case.

In my experience the disabled optimiztions and extra checks makes the partial matching code about 10% slower, but it is still considerably faster than the interpreter.

Hope you like it,
Zoltan