Boost logo

Boost :

Subject: Re: [boost] [offtopic] C++11 useful trick
From: Eric Niebler (eric_at_[hidden])
Date: 2012-07-03 13:36:11


On 7/3/2012 9:22 AM, Roland Bock wrote:
> On 2012-07-03 16:52, Mathias Gaunard wrote:
>>
>> Given your test, I suggest you benchmark the preprocessed output
>> rather than the source directly.
>
> OK, created preprocessed versions with clang -E and measured again, but
> the results are similarly close (and way too much under the influence of
> the sheer amount of bytes that need to be processed).
>
> I came up with a new test, see attachments:
>
> Without optimization:
> Eric:
> real 0m11.457s
> user 0m11.080s
> sys 0m0.330s
>
> Roland:
> real 0m11.228s
> user 0m10.790s
> sys 0m0.400s
>
> With -O3:
> Eric:
> real 0m2.910s
> user 0m2.730s
> sys 0m0.150s
>
> Roland:
> real 0m2.867s
> user 0m2.680s
> sys 0m0.160s
>
>
> Interestingly enough, Eric's version takes a bit longer to compile on my
> machine:

Too close to be very meaningful. I find that with TMP, the real costs
don't become evident until you have a non-trivial program.

> clang version 3.2 (trunk 155315)
> Target: x86_64-unknown-linux-gnu
>
> And clang crashes when I add another row of parameters in Eric's
> version. No problems with my version...

I hope you filed a bug. :-)

> Can somebody try with a different compiler? Or is this test complete
> nonsense for some reason?

-- 
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