mercredi 30 janvier 2019

Boost serialization performance issue

I am using Boost serialization to serialize data from producer to consumer. I am using stringstream to serialize into a string instead of writing to a file. I am seeing significant performance overhead due to serialization. The first step I did was to change from text_archive to binary_archive, this did help. Next, I added the following which also seems to help - BOOST_CLASS_IMPLEMENTATION(MyClass,boost::serialization::primitive_type)

Can anyone help me understand what the above line of code does? I saw it somewhere when I was googling for boost serialization, I cannot use this code unless I understand what it means.

Boost serialization has a concept of a version number. I do not care for version since in my case both producer and consumer are guaranteed to use the same version. Is there anything I can do to tell boost serialization code to not worry about versions numbers. Would this reduce the overhead?

Aucun commentaire:

Enregistrer un commentaire