Boost logo

Proto :

Subject: Re: [proto] proto::expr vs. proto::basic_expr
From: Eric Niebler (eric_at_[hidden])
Date: 2011-05-16 01:22:06


On 5/15/2011 9:19 PM, Thomas Heller wrote:
> Hi,
>
> Today I experimented a little bit with phoenix and proto.
> My goal was to decrease the compile time of phoenix. When I started the
> development of phoenix, Eric advised me to use proto::basic_expr to reduce
> compile times.
> Which makes sense giving the argumentation that on instatiating the expression
> node, basic_expr has a lot less functions etc. thus the compiler needs to
> instantiate less. So much for the theory.
> In practice this, sadly is not the case. Today I made sure that phoenix uses
> basic_expr exclusively (did not commit the changes).
>
> The result of this adventure was that compile times stayed the same. I was a
> little bit disappointed by this result.
>
> Does anybody have an explanation for this?

Impossible to say with certainty. I suspect, though, that your use case
is different than mine or, say, Christophe's. With xpressive or MSM,
compiles weren't effected by pre-preprocessing, which shows that we're
hitting limits in the speed of semantic analysis and code gen (possibly
template instantiation). Pre-preprocessing sped up Phoenix, which shows
that you're more hamstrung by lexing. The choice of either proto::expr
or proto::basic_expr doesn't matter for lexing because they're both
going to be lexed regardless.

I know when I introduced basic_expr, I ran tests that showed it was a
perf win for xpressive. But it was a small win, on the order of about
5%, IIRC. YMMV.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Proto list run by eric at boostpro.com