Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-06-05 20:50:27


I was out whacking weeds today and was thinking about this.

I'm going to guess that the unseen code in Bill example has a
number of BOOST_CLASS_EXPORT macros. The current
version will instanciate code for every combination of exported
type and included archive class. At startup there will be three
times as much code invoked to "register" these combinations.

During in the course of serialization, there are look ups into the
tables built at init time. These are stl sets, map and the like. Its
possible that the fact this combination of compiler/library
implementation consumes a disproportionate time under these
circumstances. I would guess that one would need to use
a profiler to get more information on this.

Currently code is instantiate for each combination of exported
type and included archive. Question for Dave: Is this the same
in the new improved version of export (1.35) or does the new
one only instantiate code for each archive actually used with an
<< or & operator? - Just asking.

Robert Ramey

David Abrahams wrote:
> "Robert Ramey" <ramey_at_[hidden]> writes:
>
>> How does the size of the executable vary. It shouldn't - but if
>> it does that would indicate extra code being instantiated.
>
> Of course it should vary if any classes are exported. The whole point
> of BOOST_CLASS_EXPORT is to instantiate a piece of code for each
> element in the cross-product of exported classes and visible
> archives. If you make more archives visible in the translation unit,
> more code will necessarily be instantiated (and run at startup).


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net