Boost logo

Boost :

Subject: Re: [boost] [xpressive] Performance Tuning?
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2009-07-18 21:50:18


> >> OvermindDL1 wrote:
> >>>
> >>> Parsing:  42.5
> >
> > <snip>
> >>>
> >>> spirit-grammar(threadsafe/reusable):  3.1393
> >>
> >> Thank you for pulling this together. Would you mind sharing your
> test
> >> suite?
>
> Er, I meant to attach it, it is attached now. :) It requires Boost
> trunk, and the timer file hpp I include is part of the Boost.Spirit2.1
> examples/test/somewhere_in_there area, but I included it with my cpp
> file too so you do not need to hunt for it.
> The defines at the top control what parts to compile or not, 0 to
> disable compiling for that part, 1 to enable it.
>
> My build is built with Visual Studio 8 (2005) with SP1. Compiler
> options are basically defaults, except getting rid of the secure crt
> crap that Microsoft screwed up (enabling that crap slows down Spirit
> parsers on my system, a *lot*). The exe I built is in the 7zip file
> attached. As stated, I have heard that Visual Studio handles template
> stuff like Spirit better then GCC, so I am very curious how GCC's
> timings on this file would be. There are still more changes to make
> that I intend to make, but I really want the original code in a way
> that I can use it.
> To be honest, I had to change the core::to_number lines (commented
> out) to boost::lexical_cast (right below the commented version), so the
> xpressive version could be slightly faster if I actually had the
> implementation of core::to_number available, and core::to_number was
> well made. The xpressive code also throws a nice 100 line long warning
> in my build log, all just about a conversion warning from double to
> int_64, no clue how to fix that, I do not know xpressive, so I would
> gladly like it if someone could get rid of that nasty warning in my
> nice clean buildlog. In my compiler, my Spirit2.1 grammar builds
> perfectly clean, I would like it if xpressive was the same way.

Here are my results (platform: Windows7, Intel Core Duo(tm) Processor,
2.8GHz, 4GByte RAM), I reduced the number of iterations to 1e6.

VC8SP1/32Bit
Loop count: 1000000
Parsing: 42.5
xpressive: 4.53867
spirit-quick(static): 0.213174
spirit-quick_new(threadsafe): 0.255517
spirit-grammar(threadsafe/reusable): 0.228167

VC10 beta/32Bit:
Loop count: 1000000
Parsing: 42.5
xpressive: 4.68044
spirit-quick(static): 0.245641
spirit-quick_new(threadsafe): 0.279981
spirit-grammar(threadsafe/reusable): 0.252697

VC10 beta/64Bit:
Loop count: 1000000
Parsing: 42.5
xpressive: 3.7877
spirit-quick(static): 0.17625
spirit-quick_new(threadsafe): 0.175377
spirit-grammar(threadsafe/reusable): 0.137707

gcc 4.4.1 (MinGW)/32bit
Loop count: 1000000
Parsing: 42.5
xpressive: 13.5003
spirit-quick(static): 0.274027
spirit-quick_new(threadsafe): 0.261029
spirit-grammar(threadsafe/reusable): 0.325813

gcc 4.4.1 (MinGW)/64bit
Loop count: 1000000
Parsing: 42.5
xpressive: 10.2381
spirit-quick(static): 0.0868965
spirit-quick_new(threadsafe): 0.0820163
spirit-grammar(threadsafe/reusable): 0.228892

Regards Hartmut


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk