升压序列化矢量&lt的;烧焦> [英] Boost Serialization of vector<char>

查看:175
本文介绍了升压序列化矢量&lt的;烧焦>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否序列存储在矢量成本太大的二进制序列?例如,如果我使用二进制归档。将升压::序列化库放个字符来区分载体炭元素使输出更大?

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 char elements of vector and make the output larger?

推荐答案

测量它!

排序答案:


  • 没有它不花费太多。简介它(看看它是否适合你的应用程序)

  • 不,矢量元素将难以区分POD类型的载体。
    <子>(时序列包含指向多态类向量事情的变化,这是显而易见的,因为它不能被更有效的进行,除非您有特定的数据集的额外知识)

  • 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)

存储成本:

更长的答案:


  • <一个href=\"http://stackoverflow.com/questions/22459726/boost-c-serialization-overhead/22464553#22464553\">Boost C ++序列化的开销(不同的档案比较存储效率,使用和不使用COM pression)

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

<一个href=\"http://stackoverflow.com/questions/26556145/boost-serialization-binary-archive-giving-incorrect-output/26568212#26568212\">Boost序列化二进制归档提供不正确的输出(为什么某些类型会比潜在的最低限度以上,如在64位系统上)

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

调的东西。


  • 的boost ::存档:: no_header

  • boost::archive::no_header

运行时的成本:


  • <一个href=\"http://stackoverflow.com/questions/23571355/how-to-do-performance-test-using-the-boost-library-for-a-custom-library/23572674#23572674\">how使用升压库做性能测试自定义库

调的东西。


  • 的boost ::存档:: NO_ codeCVT

  • boost::archive::no_codecvt

这篇关于升压序列化矢量&lt的;烧焦&GT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆