Binary serialization/de-serialization in C++ and C#

前端 未结 3 465
伪装坚强ぢ
伪装坚强ぢ 2021-01-19 02:42

I am working on a distributed application which has two components. One is written in standard C++ (not managed C++ and running on a Linux platform) and the

3条回答
  •  臣服心动
    2021-01-19 03:18

    gzip won't directly help with serialization - it will just (attempt to) shrink a stream. This may help, or not, depending on the amount of duplicated data in the stream. For dense data with little text, I've seen gzip increase the size of the payload.

    Personally I would look at protocol buffers here (but I'm biased, as I'm one of the authors of the many extensions). You typically (but not always) define the messages in a basic language (a .proto file), and run language-specific tools to generate the classes. Performance is very good - focusing on .NET it can far exceed the inbuilt serializers (1 2 3 )

提交回复
热议问题