[Serialization] Boost serialization how to speed it up?
I am currently trying to use boost serialization in my code and is encountering some performance issues mainly with speed of serialization and de-serialization. I am coding such that it is able to choose to serialize in both binary and XML format. My binary size is currently about 180+MB which takes a while to de-serialize Below is a sample of my code for the serialization of a struct. I have quite a few of them but they are all similarly implemented namespace boost { namespace serialization { template<class Archive> void serialize( Archive& theArchive, sim::SpeedStruct& theValue, const unsigned int theVersion ) { theArchive & BOOST_SERIALIZATION_NVP(theValue.XValue); theArchive & BOOST_SERIALIZATION_NVP(theValue.YValue); theArchive & BOOST_SERIALIZATION_NVP(theValue.ZValue); } } } BOOST_CLASS_VERSION( SpeedStruct, 1 ); BOOST_CLASS_EXPORT_GUID( SpeedStruct, "SpeedStruct" ); and the speed struct is just a simple struct with 3 double values of X,Y and Z. MY question is I read the FAQs and there is indication of various ways to speed up the process, but I am unclear of how to implement it in my code , specifically how to use BOOST_IS_BITWISE_SERIALIZABLE and also removing tracking and versioning. Thanks! Lester
participants (1)
-
tang qingxiong