Boost logo

Boost :

Subject: Re: [boost] BOOST_FOREACH slow?
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2008-11-19 12:17:28


Eric Niebler wrote:
> Bjørn Roald wrote:
>> David Abrahams wrote:
>>> Just curious: you didn't compare with std::for_each (e.g. to see the
>>> effects of loop unrolling), did you?
>>>
> <snip>
>>
>> I got:
>> g++ -I../../boost_1_37_0 foreach_benchmark.cpp -o foreach_benchmark
> <snip>
>
> (Don't post benchmarks for unoptimized code. People who read benchmarks
> do so because they care about performance ... so they compile with
> optimizations turned on. Not only are unoptimized benchmarks
> uninteresting, they can be downright misleading if people don't realize
> what they are looking at.)
>

While I agree that people care more about optimized code, unoptimized
code matters too. If the code is more than an order of magnitude slower
unoptimized it might not be suitable for production code. I've use
products which can't run in debug mode because they are too slow. I'm
not a fan of log file debugging.

In this case it looked fine for unoptimized to me.

-- 
Michael Marcin

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