Boost logo

Boost Users :

Subject: Re: [Boost-users] binary size:boost::serialization andboost::variant
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-01-24 11:58:04


It's not a question of the symbols. with MSVC 7.1 at least, Release mode
optimization collapses all the inline template instantiations down to code
which is no larger than one would write by hand. This can be verified
by adding the debug symbols to the release mode and disassembling
at the point where serialization is invoked. In MSVC the debug
symbols are a separate file. The "code bloat" results from that
fact that inline template code is not optimized by the comiler
in Debug builds.

These problems can occur in instantiating code which isn't called, using
the DLL version which contains ALL the library whether one uses it
or not. Using inline code in many places. This latter can be addressed
but using out of line code and instantiating explicitly. etc., etc. The
fact that that this became apparent when serializing variants doesn't
necessarily, mean that the issue could be addressed from withing the
serialization
library. It's also not clear whether you were using the serialization
library already and you just added variant or you added
serialization and variant at the same time.

Sorry I can't give more help - but it's the best I can do with the
"It wasn't to big until I started serializing variants, which was when it
got huge."

Robert Ramey

Tyler Littlefield wrote:
> hello,
> It wasn't to big until I started serializing variants, which was when
> it got huge. currently the 13m is in debug, but even without the
> debug symbols it's about 1.1m larger than it was before I took the
> leap to boost.
>
> Thanks,
> Tyler Littlefield
> http://tds-solutions.net
> Twitter: sorressean
>
> On Jan 23, 2010, at 10:44 PM, Robert Ramey wrote:
>
>> do you use static or dynamic linking of the library? I presume this
>> is compiled for release. This issues with size are related to
>> template programming in general and not to the serialization
>> library in particular.
>>
>> Robert Ramey
>>
>>
>> Tyler Littlefield wrote:
>>> Hello,
>>> When working with the serialization my project's binary isn't overly
>>> bloated, until I add in the serialization. The debug size becomes
>>> about 13M with the size of the binary with symbols stripped being
>>> about 1.1M larger than before I included the variant.hpp. Is there
>>> any reason for this, or a way it can be solved? I'd rather not
>>> distribute a binary this large if I can help it.
>>>
>>> Thanks,
>>> Tyler Littlefield
>>> http://tds-solutions.net
>>> Twitter: sorressean
>>
>>
>>
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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