C++ 序列化性能

发布于 2024-07-15 03:42:02 字数 371 浏览 1 评论 0原文

我正在构建一个分布式 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柒夜笙歌凉 2024-07-22 03:42:02

有人问了一个非常相似的问题:
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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文