Boost logo

Boost Users :

Subject: Re: [Boost-users] Reducing the size of .obj file whichdoesserialization
From: Gokulakannan Somasundaram (gokul007_at_[hidden])
Date: 2010-01-06 10:42:39


In Release mode, without the BOOST_EXPORT it's around 14MB. We have decided
to keep all of them in one DLL. Similarly we have other DLLs (in windows and
.so for linux) for other areas of the product. Can you please brief me more
on separating declarations from definitions. We have written the class
declarations in .h and the functions to be inlined in .inl and the other
functions in .cpp.

So the code organization is definitely very clean. Hence i decided to put
all the serialization code into a separate .cpp file. Is this sufficient to
use polymorphic_text_archive? The serialization actually comes in the
non-critical path and hence virtual function call is fine for us.

I will try out the .map file idea, which you suggested. Thanks and please
let me know, if there are any other suggestions.

Thanks,
Gokul.

On Wed, Jan 6, 2010 at 1:51 AM, Robert Ramey <ramey_at_[hidden]> wrote:

> My tests don't show the serialization consuming a disproportionate amount
> of
> memory.
>
> But I haven't made an application which serializes 200 classes either.
>
> One interesting idea is to have the linker generate a *.map file (in
> release
> mode)
> to show the size of modules being created.
>
> On a project this size, I would probably create it as a group of Libraries
> just to make build and code management easier. If I build those libraries
> as DLLS, then I can really see where the code is going. However,
> this requires a little more care in organizing code to be sure that
> only code actually used in loaded. This is sort of a pain - even
> more so with the serialization library - but it makes a much better
> final product.
>
> Combining this with the polymorphic archive should result
> in (almost) no code duplication. However, doing this requires
> special care in seperating declarations from definitions.
>
> Robert Ramey
>
> Gokulakannan Somasundaram wrote:
> > Hi Robert,
> > Thanks for the reply.
> >
> >
> > a) what compiler/platform are you using.
> >
> > MSVC/Windows
> >
> >
> > 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?
> >
> > Yes it is in the debug mode and the size in Debug
> > mode doesn't matter. In Release mode, it came down to 21MB.
> > When i
> > removed the BOOST_EXPORT, the size in DEBUG came down to 23MB.
>
> And what does the release mode version come down to?
>
> >
> > c) I'm doubtful that BOOST_EXPORT has this large an impact.
> > How large was the executable before you exported the derived classes?
> >
> >
> >
> > Still, i haven't formed the executable with serialization. I
> > will let you know, within a day or two.
> >
> > Please let me know, if you need any other details.
> >
> > Thanks,
> > Gokul.
> >
> >
> >
> >
> > _______________________________________________
> > Boost-users mailing list
> > Boost-users_at_[hidden]
> > http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>
> _______________________________________________
> 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