Re: [proto] proto::expr vs. proto::basic_expr

2011-05-16 Thread Eric Niebler
On 5/16/2011 12:31 PM, Thomas Heller wrote:
> You might get even faster. I noticed some places in proto that still
> instantiate a proto::expr.
> That is in the creation of operators (the lazy_matches in
> operators.hpp) instantiate a proto::expr. And the generator of
> basic_expr is the default generator which instantiates, when called a
> proto::expr as well. Not sure if that may actually matter

Yeah, THAT's not right. Thanks for pointing it out. I fixed the problem
on trunk. I had to muck with domain deduction, which makes me nervous.
The regression tests aren't running right now, so please let me know if
you spot any problems.

Thanks,

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com
___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto


Re: [proto] proto::expr vs. proto::basic_expr

2011-05-15 Thread Thomas Heller
On Mon, May 16, 2011 at 7:22 AM, Eric Niebler  wrote:
> 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.

Makes sense.

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

You might get even faster. I noticed some places in proto that still
instantiate a proto::expr.
That is in the creation of operators (the lazy_matches in
operators.hpp) instantiate a proto::expr. And the generator of
basic_expr is the default generator which instantiates, when called a
proto::expr as well. Not sure if that may actually matter
___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto


Re: [proto] proto::expr vs. proto::basic_expr

2011-05-15 Thread Eric Niebler
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 mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto