Boost logo

Boost :

Subject: Re: [boost] [fusion] improving compile times
From: Larry Evans (cppljevans_at_[hidden])
Date: 2009-06-01 23:39:10


On 06/01/09 20:26, Eric Niebler wrote:
> I'm attaching a simple patch to vector_n_chooser.hpp that replaces some
> template metaprogramming with preprocessor metaprogramming in the
> interest of improving compile times. I found this hotspot through
> profiling,
[snip]
Eric,

Could you post your benchmark code that showed the improvement in
compile speed? I'd like to eventually try it with a variadic template
compiler version of fusion vector.

Somewhat off topic:

What I'd really like to see is someone explain how metaprogramming
improves compile speed. Steven said earlier that the slowdown
depends on the template:

http://article.gmane.org/gmane.comp.lib.boost.devel/186051

I would have guessed that the more template instances that,
are created, then the slower the compile time. However,
Steven's remark made me wonder. What I'm guessing
is that if the template metaprogram produces a lot of
intermediate results, then it might be better to
use preprocessor metaprogramming to just produce the
final result. Is that about right or is it more
complicated?

-regards,
Larry


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