Boost logo

Boost :

Subject: Re: [boost] Phoenix3 port to proto complete
From: Thomas Heller (thom.heller_at_[hidden])
Date: 2010-07-26 06:49:51


Doug Gregor wrote:

> On Fri, Jul 23, 2010 at 11:14 AM, Thomas Heller
> <thom.heller_at_[hidden]> wrote:
>> Mathias Gaunard wrote:
>>
>>> On 23/07/10 14:18, Thomas Heller wrote:
>>>> Ladies and Gentlemen,
>>>> I proudly announce that the port of phoenix3 is completed! All
>>>> testcases pass! (some with minor modifications)
>>>>
>>>> So, What is next? Here is my proposed schedule:
>>>> - fix some minor issues
>>>> - improve boost.bind compatibility: make all boost.bind testcases pass
>>>> - implement all boost.lambda testcases and make them pass, as far as it
>>>> is
>>>> reasonable
>>>> - add support for C++0x lambdas
>>>> - make interoperability testcases for std::function, boost::function
>>>> - adapt the documentation
>>>> - clean up code (some parts are a little messy as of now)
>>>> - improve compile time
>>>>
>>>> Did I miss something?
>>>
>>> I would quite like to know how Phoenix 3 compares to Phoenix 2 in terms
>>> of compile speed, even if you haven't fully optimized it yet.
>>
>> Let me give you a small example of what situation we currently have:
>>
>> For this test i used the core/primitives_test.cpp test and g++ 4.5
>>
>> Phoenix3 total compile time: 3.421s
>> Phoenix3 preprocess time: 1.755s
>> Phoenix3 compile time of preprocessed code: 1.835s
>>
>> Phoenix2 total compile time: 1.891s
>> Phoenix2 preprocess time: 0.745s
>> Phoenix2 compile time of preprocessed code: 1.106s
>>
>> comparing with clang:
>>
>> Phoenix3 total compile time: 3.901s
>> Phoenix3 preprocess time: 2.738s
>
> Ouch! The Clang guys will be looking into this
> preprocessor-performance issue to see if we can do better. Thanks for
> reporting this!
>
> - Doug

Thanks for looking into this!

FYI, I was able to identify one bottleneck for the preprocessor.
It was by including boost/fusion/include/vector.hpp. I instead included the
different boost/fusion/container/vector/vectorN.hpp and was able to reduce
compile-time by one second.
New timings for the above test are:
thomas_at_sunshine ~/programming/boost $ compile-time g++ -I.
libs/phoenix/test/core/primitives_tests.cpp
complete compile time:

real 0m2.385s
user 0m2.253s
sys 0m0.120s

preprocessing time:

real 0m1.254s
user 0m1.230s
sys 0m0.017s

compile time without preprocessing:

real 0m1.234s
user 0m1.157s
sys 0m0.067s
thomas_at_sunshine ~/programming/boost $ compile-time clang++ -I.
libs/phoenix/test/core/primitives_tests.cpp
complete compile time:

real 0m2.709s
user 0m2.337s
sys 0m0.340s

preprocessing time:

real 0m1.765s
user 0m1.417s
sys 0m0.337s

compile time without preprocessing:

real 0m1.011s
user 0m0.913s
sys 0m0.080s


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