[Boost-bugs] [Boost C++ Libraries] #9116: Binary serialization: bitwise copying should also apply to single POD objects (it now only seems to work on arrays/collections)

Subject: [Boost-bugs] [Boost C++ Libraries] #9116: Binary serialization: bitwise copying should also apply to single POD objects (it now only seems to work on arrays/collections)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-09-14 19:03:26


#9116: Binary serialization: bitwise copying should also apply to single POD
objects (it now only seems to work on arrays/collections)
-------------------------------------------------+-------------------------
 Reporter: Louis Zanella <louis.zanella@…> | Owner: ramey
     Type: Bugs | Status: new
Milestone: To Be Determined | Component:
  Version: Boost 1.53.0 | serialization
 Keywords: serialization, binary, bitwise, POD | Severity:
                                                 | Optimization
-------------------------------------------------+-------------------------
 I'm trying to find the best settings for fast binary serialization of big
 POD objects. My tests indicate that, for a structure tagged as bitwise
 serializable, I only get better performance on arrays and vectors, not on
 individual objects.

 For instance, say I have a structure made up only of POD types:

 {{{
 struct BigStruct
 {
   double m1;
   long long m2;
   float m3;
   // ...
   bool m499;
   short m500;
 };

 namespace boost
 {
   namespace serialization
   {
     template <class Archive>
     void serialize(Archive& ioArchive, BigStruct& ioStruct, const unsigned
 int iVersion)
     {
       ioArchive & ioStruct.m1;
       ioArchive & ioStruct.m2;
       ioArchive & ioStruct.m3;
       // ...
       ioArchive & ioStruct.m499;
       ioArchive & ioStruct.m500;
     }
   }
 }

 #include <boost/serialization/is_bitwise_serializable.hpp>
 BOOST_IS_BITWISE_SERIALIZABLE(BigStruct);
 }}}

 Then, serializing a single !BigStruct object takes considerably (at least
 5 times) longer than serializing an array of 1 !BigStruct object.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9116>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC