Boost logo

Boost :

Subject: Re: [boost] [xpressive] Performance Tuning?
From: Joel de Guzman (joel_at_[hidden])
Date: 2009-07-28 13:17:06


Edward Grace wrote:

>> That is a *lot* more reasonable, although Spirit is still most
>> definitely faster then the built-in functions. :)
>
> That's good though - one up for Boost!

My latest benchmarks for integers and floating points reveal
a 3x speed over atoi/strtol and friend C functions. You
mentioned a need to parse small numbers very quickly? Spirit
does. The tests I have take that into consideration too. If you
guys want to take a peek, it's in the Boost trunk in libs/benchmarks.

Some numbers:

///////////////////////////////////////////////////////////////////////////
atoi_test: 0.9265067422 [s] {checksum: d5b76d60}
strtol_test: 1.0766213977 [s] {checksum: d5b76d60}
spirit_int_test: 0.3097019879 [s] {checksum: d5b76d60}

///////////////////////////////////////////////////////////////////////////
atof_test: 7.3012049917 [s] {checksum: 3b7d82b0}
strtod_test: 8.0042894122 [s] {checksum: 3b7d82b0}
spirit_double_test: 2.6729373333 [s] {checksum: 3b7d82b0}

This time, I am using the benchmarking harness by David Abrahams,
Matthias Troyer, Michael Gauckler. It's the one used in timing
the overhead of Boost.Parameter. You are welcome to try it out
with your timer, Edward.

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

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