|
Boost : |
Subject: Re: [boost] [explore] Library Proposal: Container Streaming
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2009-12-01 13:57:25
David Bergman wrote:
> On Dec 1, 2009, at 12:47 PM, Vladimir Prus wrote:
>
>> Robert Ramey wrote:
>
>>> I didn't have to write even one line to template code to
>>> implement the example.
>>
>> I though boost.serialization was written by you?
>
> The example is quite distinct from the library being used...
>
> In other words, there is a special quality of Boost.Serialization that is of importance: it
> exists. So, we are allowed to use it, and by using it, we have to write very little code
> ourselves, beside a number of include statements. Great!
If this new proposed library is accepted, you get to write just as little code, if not less.
>
>> And that code still has
>> to be parsed by the compiler.
>
> This is a different issue. Is that your problem, that you think compilers have a problem with some
> complex constructs inside the Boost.Serialization library? Does the compiler fail? Consume too
> much resources? Too much time?
Yes, too much time and resources. When building debug variant, an program that does nothing
but creates std::vector<int> is a 53K object file. When I add serialization, I get:
- a useless warning shown below, and no, I am not willing to apply const_cast or declare things
const just because Boost.Serialization has strange position about what const really means
- a 387K object file
When doing a release build, the source with serialization takes 1.3 second to compile, while
the empty one takes 0.3 second.
It does not seem like this overhead is justifiable for a trivial task of just getting my
std::vector printed.
- Volodya
../../../boost/mpl/print.hpp: In instantiation of
âboost::mpl::print<boost::serialization::STATIC_WARNING_LINE<98> >â:
../../../boost/serialization/static_warning.hpp:92: instantiated from
âboost::serialization::static_warning_test<false, 98>â
../../../boost/archive/detail/check.hpp:98: instantiated from âvoid
boost::archive::detail::check_object_tracking() [with T = std::vector<int, std::allocator<int> >]â
../../../boost/archive/detail/oserializer.hpp:313: instantiated from âstatic void
boost::archive::detail::save_non_pointer_type<Archive>::invoke(Archive&, T&) [with T =
std::vector<int, std::allocator<int> >, Archive = boost::archive::text_oarchive]â
../../../boost/archive/detail/oserializer.hpp:525: instantiated from âvoid
boost::archive::save(Archive&, T&) [with Archive = boost::archive::text_oarchive, T =
std::vector<int, std::allocator<int> >]â
../../../boost/archive/detail/common_oarchive.hpp:69: instantiated from âvoid
boost::archive::detail::common_oarchive<Archive>::save_override(T&, int) [with T = std::vector<int,
std::allocator<int> >, Archive = boost::archive::text_oarchive]â
../../../boost/archive/basic_text_oarchive.hpp:80: instantiated from âvoid
boost::archive::basic_text_oarchive<Archive>::save_override(T&, int) [with T = std::vector<int,
std::allocator<int> >, Archive = boost::archive::text_oarchive]â
../../../boost/archive/detail/interface_oarchive.hpp:64: instantiated from âArchive&
boost::archive::detail::interface_oarchive<Archive>::operator<<(T&) [with T = std::vector<int,
std::allocator<int> >, Archive = boost::archive::text_oarchive]â
d.cpp:13: instantiated from here
../../../boost/mpl/print.hpp:55: warning: comparison between signed and unsigned integer expressions
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk