Author: A B Date: To: pcre-dev Subject: [pcre-dev] Improving PCRE performance for HTTP first line
Hi,
My name is Amit; I am dealing with http parsing, especially with extracting
fields from HTTP first line (At the end, I would like to get a general
parsing solution, which will enable me to also parse other “first lines”,
for example, RTSP)
Using PCRE enabled me to quickly get the functionality & flexibility I need.
However, the performance is problematic compared to parsing using c code.
I’m aware that the flexibility of PCRE costs performance & I don’t expect to
get the same performance as specialized c code parser, but still I need to
significantly improve the performance of the PCRE option…
This is the regex I use (I also use captures for method, URI & version)
-> I try to avoid backtracking by using ++; will it indeed prevent PCRE from
backtracking?
-> I currently use pcre_exec (not dfa). I read about the “DFA” in the
pcre.txt, from it seems that pcre_dfa_exec will not improve performance… but
maybe for my special case above the DFA can improve the performance?
*** I will be happy to get any suggestions for improving the PCRE
performance for my case above.