build times and Boost.Function
Dear all,
this would be my 3 post on build times and Boost, since we develop a fairly
large system (> 3000 classes) and use Boost a lot.
Rebuilding the complete system takes about 2 hours on my home pc (DELL P4
2GHz, 512 Mb) and about 1 hour on my pc @ work (DELL G280, P4, ht, 3.0 GHz, 1
Gb memory). We already use precompiled headers and tend to forward declare as
much as possible.
Using some of the Boost components in headers is just out of the question
because of the increased build times:
- exposing the Boost.MultiIndex headers in a much used header drammatically
increases build times
- same argument for
On Fri, Aug 8, 2008 at 2:05 PM, gast128
Dear all,
this would be my 3 post on build times and Boost, since we develop a fairly large system (> 3000 classes) and use Boost a lot.
Rebuilding the complete system takes about 2 hours on my home pc (DELL P4 2GHz, 512 Mb) and about 1 hour on my pc @ work (DELL G280, P4, ht, 3.0 GHz, 1 Gb memory). We already use precompiled headers and tend to forward declare as much as possible.
Using some of the Boost components in headers is just out of the question because of the increased build times: - exposing the Boost.MultiIndex headers in a much used header drammatically increases build times - same argument for
- including give also a huge latency However I also notice that Boost.Function does not have an include guard. Boost.Function is used a lot and exposed through a lot of headers in our code (since they often define a callback interface). Adding an include guard myself drops the build time for a test project dramatically if Boost.Function is included recursively:
- include guards + pch 0.42 - include guards 0.35 - normally 1.52
Is there a reason that
does not have an include guard? Does it harm when adding one (or using a wrapper around it, i.e. "incboostfunction.h" which has an include guard)?
If you need boost::function just to declare a function that takes a
boost::function as parameter or returns it as result, with boost
version 1.36 you can do:
namespace boost { template <class> class function; }
void foo( boost::function
If you need boost::function just to declare a function that takes a boost::function as parameter or returns it as result, with boost version 1.36 you can do:
namespace boost { template <class> class function; } void foo( boost::function
const & );
A similar thing works in <= 1.35, but you have to take account of
allocators, IIRC.
And when you actually need the include, it is quicker to include
AMDG gast128 wrote:
Is there a reason that
does not have an include guard? Does it harm when adding one (or using a wrapper around it, i.e. "incboostfunction.h" which has an include guard)?
I don't think there's a problem with having an include guard on boost/function.hpp Please create a ticket at svn.boost.org In Christ, Steven Watanabe
I'm trying to create a type of argument which can occur in the language skill. What do you think? Any other suggestions?
#include
AMDG peter_foelsche@agilent.com wrote:
I'm trying to create a type of argument which can occur in the language skill. What do you think? Any other suggestions?
#include
#include <vector> #include struct CSkillType:boost::variant
> { };
http://www.boost.org/doc/libs/1_35_0/doc/html/variant/tutorial.html#variant.... In Christ, Steven Watanabe
nope -- shared_ptr is not necessary -- auto_ptr would suffice:
#include
- including
give also a huge latency Did you try to include the specific boost/type_traits/xxx.hpp files you need rather than the whole type_traits.hpp? They are here precisely for that, AFAIK.
Yes normally I only include the one needed. However it was just meant to be illustrative. I have to investigate it better, but it may well turn out that some headers of type_traits are just to heavy.
participants (6)
-
Bruno Lalande
-
Emil Dotchevski
-
gast128
-
Pete Bartlett
-
peter_foelsche@agilent.com
-
Steven Watanabe