[cmake-developers] slow regex implementation in RegularExpression

Alexandru Ciobanu alex at rogue-research.com
Tue Nov 22 13:50:46 EST 2011


On 2011-11-17, at 3:59 PM, Brad King wrote:

> On 11/17/2011 3:19 PM, Alexandru Ciobanu wrote:
> > I was able to make CMake use TRE, by changing the
> > RegularExpression.{cxx,hxx.in} files.
> 
> Those are down in Source/kwsys which is a directory shared by
> projects other than just CMake.  We cannot touch the files there.
> Instead you will need to re-factor things to go through a wrapper.
> The first stage will just wrap up the KWSys regular expression API.
> The second stage will replace the implementation with TRE.
> 
>> - Does anyone see a problem if we add TRE in CMake the same
> > way as ZLIB, CURL, etc? (i.e. in ./Utilities/)
> 
> That should be fine.
> 
> -Brad


Hi,

As Brad King suggested, instead of changing the files in Source/kwsys/, I created a wrapper class and made all the calls go through it.

I also added the TRE library to Utilities/cmtre, and added CMAKE_USE_SYSTEM_TRE.

I added the patch to the bug tracker:
     http://public.kitware.com/Bug/view.php?id=12381

Needless to say, the patch fixes the performance problem.

To keep things simple I omitted several things:
   - TRE library bootstrapping (so now the Bootstrap test will fail)
   - the suggested policy to enable/disable approximate matching in TRE 
   - proper checks when building TRE with CMake as done in its ./configure.ac 

Before I spend more time on that I would like to get some feedback, and namely:
   - Is the approach correct?
   - What next?

sincerely,
Alex Ciobanu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20111122/e37453be/attachment.html>


More information about the cmake-developers mailing list