Boost logo

Boost Users :

Subject: Re: [Boost-users] Reducing the size of .obj file which doesserialization
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-01-05 12:38:59


a) what compiler/platform are you using.
b) 37 MB suggests that you're including the debug symbols. Assuming this
is correct, how large is it when compiling for release. Does the size
of the debug version really matter?
c) I'm doubtful that BOOST_EXPORT has this large an impact.
How large was the executable before you exported the derived classes?

Gokulakannan Somasundaram wrote:
> Hi,
> I have a parent class which has around 200 sub-classes. While
> serializing the entire hierarchy, i have lot of base class pointers
> and STLs of base class pointers. From the documentation, i found that
> if i have to serialize the polymorphic pointers, then i have to do a
> BOOST_EXPORT of all the relevant subclasses. But after doing that, i
> find my .obj file to be around 37MB. I am using the text archive in
> my code. When i tried the polymorphic_text_archive, the size only
> reduced by 3MB.
> Can someone help me on how i should go about reducing the .obj
> file size?
>
> Some of my questions are
> a) One approach, i could think of is to create a virtual function in
> the hierarchy, which just takes the Archive and does the
> serialization. This would help me, because i don't need to have the
> BOOST_EXPORT, which increases the size of the .obj file.

> b) Why is BOOST_EXPORT required for polymorphic_text_archive? Since
> it anyway uses virtual functions instead of templates, why does it
> need the derived class definition.

Assuming that one is not using the no_rtti type info system,
the usage of BOOST_EXPORT should be unrelated to the
usage of polymorphic_?archives.

> Thanks,
> Gokul

Robert Ramey
.


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