Boost Serialization of vector

后端 未结 1 1681
执笔经年
执笔经年 2021-01-24 03:49

Does serializing a binary sequence stored in vector cost much? For example if I am using binary archive. Will the boost::serialization library put characters to differentiate ch

1条回答
  •  清酒与你
    2021-01-24 03:52

    Measure it!

    The sort answers:

    • No it doesn't cost much. Profile it (and see whether it fits your application)
    • No, vector elements will not be differentiated for vectors of POD types.
      (Things change when you serialize vectors containing pointers to polymorphic classes. This is obvious, since it couldn't be done more efficiently unless you have extra knowledge about the particular dataset)

    The storage cost:

    Longer answers:

    • Boost C++ Serialization overhead (comparative storage efficiency of different archives, with and without compression)

    • Boost Serialization Binary Archive giving incorrect output (on why some types take more than the potential bare minimum, e.g. on 64bit systems)

    • Tune things

      • boost::archive::no_header

    The runtime cost:

    • how to do performance test using the boost library for a custom library

    • Tune things

      • boost::archive::no_codecvt

    0 讨论(0)
提交回复
热议问题