C++ 序列化性能
我正在构建一个分布式 C++ 应用程序,该应用程序需要对存储在 std 容器中的数据进行大量序列化和反序列化。
目前采用Boost.serialization。 然而,它的表现很糟糕。 我们的B树也使用Boost.serialization来存储键值对数据,但是,如果我们将Boost.serialziation改为memcpy,访问速度将提高10倍甚至更多。 由于目前的分布式平台,需要进行大量的数据交换,因此还需要易于编程和高性能。 我知道protocol buffer也可以用作序列化机制,但是,我不确定Boost.serialization和protocol buffer之间的性能比较,另一个问题是,是否存在更好的解决方案来提供接近memcpy的更高性能?
谢谢
I'm building a distributed C++ application that needs to do lots of serialization and deserialization of data stored in std containers.
Currently Boost.serialization is adopted. However, it performs terrible. Our B-tree also use Boost.serialization to store key-value pair data, however, if we change Boost.serialziation to memcpy, the accessing speed will be improved 10 times or more. Since given the current distributed platform, so many data exchange are needed, therefore easy programming is also required together with high performance. I know protocol buffer could also be used as a serialization mechanism, however, I am not sure about the performance comparison between Boost.serialization and protocol buffer, another issue is , does there exist any better solutions to provider higher performance as close to memcpy?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有人问了一个非常相似的问题:
C++ 序列化性能
看起来协议缓冲区是一个不错的选择,尽管不知道应用程序的要求,很难推荐任何特定的库或技术。
Someone asked a very similar question:
C++ Serialization Performance
It looks like protocol buffers are a good way to go, though without knowing your applications' requirements, it is hard to recommend any particular library or technique.