MEDIUM: regex: Use PCRE JIT in acl
This is a patch for using PCRE JIT in acl.
I notice regex are used in other places, but they are more complicated
to modify to use PCRE APIs. So I focused to acl in the first try.
BTW, I made a simple benchmark program for PCRE JIT beforehand.
https://github.com/hnakamur/pcre-jit-benchmark
I read the manual for PCRE JIT
http://www.manpagez.com/man/3/pcrejit/
and wrote my benchmark program.
https://github.com/hnakamur/pcre-jit-benchmark/blob/master/test-pcre.c
diff --git a/Makefile b/Makefile
index a78e9d9..daa64ee 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@
# USE_MY_SPLICE : redefine the splice syscall if build fails without.
# USE_NETFILTER : enable netfilter on Linux. Automatic.
# USE_PCRE : enable use of libpcre for regex. Recommended.
+# USE_PCRE_JIT : enable use of libpcre jit for regex. Recommended.
# USE_POLL : enable poll(). Automatic.
# USE_PRIVATE_CACHE : disable shared memory cache of ssl sessions.
# USE_REGPARM : enable regparm optimization. Recommended on x86.
@@ -521,7 +522,7 @@
endif
endif
-ifneq ($(USE_PCRE)$(USE_STATIC_PCRE),)
+ifneq ($(USE_PCRE)$(USE_STATIC_PCRE)$(USE_PCRE_JIT),)
# PCREDIR is used to automatically construct the PCRE_INC and PCRE_LIB paths,
# by appending /include and /lib respectively. If your system does not use the
# same sub-directories, simply force these variables instead of PCREDIR. It is
@@ -546,6 +547,10 @@
OPTIONS_LDFLAGS += $(if $(PCRE_LIB),-L$(PCRE_LIB)) -Wl,-Bstatic -lpcreposix -lpcre -Wl,-Bdynamic
BUILD_OPTIONS += $(call ignore_implicit,USE_STATIC_PCRE)
endif
+# JIT PCRE
+ifneq ($(USE_PCRE_JIT),)
+OPTIONS_CFLAGS += -DUSE_PCRE_JIT
+endif
endif
# This one can be changed to look for ebtree files in an external directory