b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | config PCRE2_JIT_ENABLED |
| 2 | bool |
| 3 | depends on PACKAGE_libpcre2 && (aarch64 || aarch64_be || arm || i386 || i686 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc || powerpc64 || powerpcle || sparc) |
| 4 | default y if (arm || i686 || x86_64) |
| 5 | prompt "Enable JIT compiler support" |
| 6 | help |
| 7 | Enable JIT (Just-In-Time) compiler support. |
| 8 | |
| 9 | Just-in-time compiling is a heavyweight optimization that can greatly |
| 10 | speed up pattern matching. However, it comes at the cost of extra |
| 11 | processing before the match is performed, so it is of most benefit when |
| 12 | the same pattern is going to be matched many times. This does not |
| 13 | necessarily mean many calls of a matching function; if the pattern is |
| 14 | not anchored, matching attempts may take place many times at various |
| 15 | positions in the subject, even for a single call. Therefore, if the |
| 16 | subject string is very long, it may still pay to use JIT even for |
| 17 | one-off matches. JIT support is available for all of the 8-bit, 16-bit |
| 18 | and 32-bit PCRE2 libraries and adds about 100KB to the resulting |
| 19 | libpcre2.so. JIT support applies only to the traditional Perl-compatible |
| 20 | matching function. It does not apply when the DFA matching function is |
| 21 | being used. |
| 22 | |
| 23 | Enabling this option can give an about 10x performance increase on JIT |
| 24 | operations. It can be desireable for e.g. high performance Apache |
| 25 | mod_rewrite or HA-Proxy reqrep operations. |
| 26 | |
| 27 | However, JIT should _only_ be enabled on architectures that are supported. |
| 28 | Enabling JIT on unsupported platforms will result in a compilation |
| 29 | failure. A list of supported architectures can be found here: |
| 30 | https://pcre.org/current/doc/html/pcre2jit.html#SEC2 |