Glibc regexp effect

Does anyone have experience measuring glibc regex functions? Are there some general tests I need to perform to make these measurements (in addition to testing the exact patterns that I intend to look for)?

Thanks.

0
regex glibc


a source to share


3 answers


The effectiveness of regular expressions depends a lot on what kind of regular expression you are using and what data you are using. There's little point in just parsing a bunch of regexes. You have to compare the actual code with the regex and your real simple C alternative on your actual data.



Generally, I would say that if you already have properly functioning procedural code to match the required text, just leave that in place. If you don't already have this code, I recommend starting with regular expressions, as you will save a lot of development time (assuming you are familiar with regular expressions). You can probably write procedural code that is faster than the equivalent regex, but the difference won't be significant. The effort to write and maintain procedural code will be significantly higher than using a regular expression.

0


a source to share


take a look http://www.boost.org/doc/libs/1_41_0/libs/regex/doc/gcc-performance.html



+1


a source to share


Are you using handwritten char -by- char comparison, standard string matching functions, or smart text matching algorithms?

In the first case, switching to regex may be even faster, depending on the type of regex and the library you are using (there are not only glibc, there are many libraries out there: PCRE, the ones listed here, and much more).

+1


a source to share







All Articles