|
Boost : |
Subject: Re: [boost] Phoenix v3 review
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-02-25 21:05:33
On 2/25/2011 10:54 PM, Mathias Gaunard wrote:
> On 25/02/2011 13:35, Joel de Guzman wrote:
>
>> Exactly. Phoenix functions are not proto terminals. I agree with
>> Thomas, I'd like to see the numbers first before jumping to a conclusion.
>
> The attached example tries to demonstrate the difference using a simplistic "function"
> definition that merely forwards to the wrapped PFO.
> I've only considered unary functions for simplicity.
>
> I ran the tests with GCC 4.5 with -O3.
>
> On my platform, for 4096 functions, using global objects compiles in 7 seconds, while
> using free functions compiles in 550 ms.
>
> The size overhead is fairly minimal, 992 bytes for the global version and 643 for the
> function version.
>
> Now, if I change function to be a POD, both tests end up with an object size of 644 bytes,
> and the compile time of the global version gets down to 650 ms, making it almost as good
> as the free function case.
That is very good information, Mathias. Thank you very much for doing this.
This is indeed very enlightening. So, either make them global functions,
or make them true PODs. I'll discuss this off list with Thomas.
Regards,
-- Joel de Guzman http://www.boostpro.com http://boost-spirit.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk