|
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:
> https://svn.boost.org/svn/boost/sandbox/tools/profile_templates. It is
> also in the Boost Vault and can be downloaded from here:
> http://www.boostpro.com/vault/index.php?action=downloadfile&filename=profile_templates.zip&directory=Tools&
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.
Isn't profiling interesting?
-- Eric Niebler BoostPro Computing http://www.boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk