[cmake-developers] slow regex implementation in RegularExpression

Brad King brad.king at kitware.com
Wed Nov 16 15:05:14 EST 2011


On 11/16/2011 2:12 PM, Alexandru Ciobanu wrote:
> This is how I run the tests (pseudocode):
>     recomp()
>     repeat 1000 times:
>         regexec()

Thanks for the explanation.

>      TRex  --  680ms
>      PCRE  -- 610ms  ( with pcre_exec() )
>      PCRE  -- 990ms  ( with pcre_dfa_exec() )
>      re2  --  0.085ms
>      /usr/include/regex.h  -- 0.075ms
>      TRE  --  0.3ms

The performance variation is interesting.  It is probably worthwhile
to use a profiling tool (such as valgrind --tool=callgrind and kcachegrind)
to see where PCRE is spending its time.

> Advantages of TRE:
>    - API very similar to standard regex.h (i.e. easy to integrate with CMake)
>    - supports wide characters
>    - compiles on many platforms Windows, AIX, HP-UX, you name it.
>
> What do you think about TRE?

It looks like a promising candidate.

Thanks,
-Brad



More information about the cmake-developers mailing list