Re: [Cppcms-users] Moving from boost::regex to re2 and ability to go without regex checks
Brought to you by:
artyom-beilis
|
From: Lee E. <le...@el...> - 2013-09-30 11:56:50
|
shouldn't the condition in your sample should be: if((sequenceLen<=simplifiedPatternLength)||(sequence[simplifiedPatternLength]!='/')) about your point - using regEx is great for ease of configuration & building i like the ability to change the regex implementation being used (not just for performance) but using your own functions - or preferably function objects will be the best in my opinion and then just provide a default function object (or lambda) that uses the boost::regex engine On Mon, Sep 30, 2013 at 1:28 AM, Arsen Zahray <me...@gm...> wrote: > Hey. I'd like to discuss a possibility of changing the way the app handles > regex evaluations. > > Some time ago, I heavily used regex. That was before I found out, that it > was killing my app's performance. After I got rid of it, my app's speed > improved by at least 10 times. > > So, here are few suggestions I'd like to discuss implementing: > > 1. Move from boost::regex (the app seems to be using that if I'm not > mistaken) to re2 (it was developed by google for performance critical apps, > and it seems to do the job well enough). re2 doesn't compile for windows, > but the vast majority of cppcms users will use framework under linux (me > included) > > 2. Give the users ability to go without regex altogether. Let us just pass > along function pointers instead of regex strings. Performance wise, there > is nothing that beats a function pointer. > > I've set up some benchmarks to demonstrate what I mean. Build commands: > > g++ -std=c++11 -Wall -fexceptions -g -c main.cpp -o main.o > g++ -o regex-tests main.o -lre2 -lbooster -lboost_regex > > I'm attaching the source, and here are the test results: > > RE2: 326069 > boost::regex: 2164850 > function pointers; 27878 > > Because cppcms is going to be used by those, who want top performance for > the apps, I think that this is a way forward for the library. > > What do you guys think? > > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |