I am interested in serializing data structures like vector< pair< boost::date_time::ptime , double> > as quickly as possible.

 

I see that ptime is a serializable object (in the Boost.Serialization sense) but on the surface this implementation looks slow – we first get a date and time_duration and then serialize the various components (mins,secs,subsecs) separately for the latter and construct a full ISO string for the date. Something faster is surely possible – digging into the implementation it looks like a (non-special) ptime is represented as boost::uint64_t so if we were privy to all implementation details we could use serialize that. However on this glance this doesn’t seem possible non-intrusively. Perhaps I’ve missed something, perhaps there’s a third way – I would be grateful if any could share any ideas.

 

Thanks,

Pete