Boost logo

Boost :

Subject: Re: [boost] Phoenix Reloaded
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2009-05-29 18:11:52

Eric Niebler wrote:

> Also added to the wiki are the result of a template profile run over
> miniphoenix.cpp. The results should interest Aleksey:
> Total instantiations: 2983
> Location count cum.
> -----------------------------------------------------------
> C:\boost\org\trunk\boost/mpl/if.hpp(56) 59 59
> C:\boost\org\trunk\boost/mpl/if.hpp(44) 48 107
> <snip>
> The top two templates instantiated in this program are mpl::if_ and
> mpl::if_c, respectively. The sad thing is that most of the
> instantiations of mpl::if_c are totally unnecessary. mpl::if_ happens
> to
> be implemented in terms of mpl::if_c so that any instantiation of
> mpl::if_ causes an additional instantiation of mpl::if_c.
> If anything can be done to eliminate this unnecessary instantiation,
> it'll speed up most template metaprograms across the board. For my
> part,
> I always take care in Proto to use mpl::if_c instead of mpl::if_ for
> just this reason, but other libraries used by Proto don't take this
> measure.

That's good to know. It justifies to get back to Spirit and change all if_<>
to be if_c<>. I'll probably go ahead and do that asap.

> Isn't profiling interesting?

Indeed. It's always pointing to things nobody expected to be a problem...

Regards Hartmut

Boost list run by bdawes at, gregod at, cpdaniel at, john at