|
Boost : |
Subject: Re: [boost] [xpressive] Performance Tuning?
From: Eric Niebler (eric_at_[hidden])
Date: 2009-06-30 17:36:11
Stewart, Robert wrote:
> I was experimenting with Xpressive to see how it would compare with
> some custom, string-based numeric input parsing. The Xpressive code
> is over 175X slower than the custom code. Have I done anything to
> make it really slow? Can it be made faster?
<snip>
Where is the code against which you are benchmarking?
From looking at the code, I can see a few areas for improvement. With
each call to parse(), you construct and discard a match_results object.
For optimal performance, you should reuse the match_results object to
avoid extra memory allocation. Also, many of the quantifiers in your
grammar do not require backtracking, so you could use keep() to turn
backtracking off selectively.
That's all I have for now.
-- Eric Niebler BoostPro Computing http://www.boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk