Boost logo

Boost :

Subject: Re: [boost] Phoenix Reloaded
From: Eric Niebler (eric_at_[hidden])
Date: 2009-05-29 16:19:45

Eric Niebler wrote:
> Added to the Wiki:
> Steven Watanabe's template profiler is checked into the Boost sandbox
> and can be checked out here:
> It is
> also in the Boost Vault and can be downloaded from here:

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

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.

Isn't profiling interesting?

Eric Niebler
BoostPro Computing

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