Boost logo

Boost Users :

Subject: Re: [Boost-users] [PROTO] Custom functions, scalar terminal and make_expr vs details::as_expr_if
From: Eric Niebler (eric_at_[hidden])
Date: 2008-11-30 12:46:17


Joel Falcou wrote:
> Eric Niebler a écrit :
>> If you want to improve compile times even more, you can avoid
>> make_expr entirely and code by-hand what make_expr would do. So, e.g.,
>> the second overload above would be:
>> <snip>
> Why is this faster than calling make_expr ? Even worse, doesn't it
> defeat the proto purpose ?

There's one more thing I wanted to say about this. No, it doesn't defeat
Proto's purpose. Proto provides high-level facilities so you can do a
lot in just a little code. This is very important when you are just
starting out with your DSEL and your code is in flux. Use those
high-level facilities to keep your design fungible. When you're happy
with your design, *then* you can go back and optimize for compile times
by replacing some of the more expensive facilities with more efficient
lower-level ones.

A good example of this is transforms. Joel is using composite transforms
(object and callable transforms, specified with function types) when
building Spirit2x. It makes the code very small and nimble, and he can
easily change his mind and make radical changes at this stage. When
things are stable, he'll go through and replace all the composite
transforms with custom primitive transforms to improve compile times.
Does that mean composite transforms are useless? Not at all.

HTH,

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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net