C++ Serialization Performance

前端 未结 8 940
情深已故
情深已故 2020-12-02 15:55

I\'m building a distributed C++ application that needs to do lots of serialization and deserialization of simple data structures that\'s being passed between different proce

8条回答
  •  不思量自难忘°
    2020-12-02 16:48

    My guess is that boost is fast enough. I have used it in previous projects to serialize data to and from disk, and its performance never even came up as an issue.

    My answer here talks about serialization in general, which may be helpful to you beyond which serialization library you choose to use.

    Having said that, it looks like you know most of the main trouble spots with serialization (endianess string encoding). You did leave out versioning and forwards/backwards compatibility. If time is not critical I recommend writing your own serialization code. It is an enlightening experience, and the lessons you learn are invaluable. Though I will warn you it will tend to make you hate XML based protocols for their bloatedness. :)

    Whichever path you choose good luck with your project.

提交回复
热议问题