boost序列化与谷歌协议缓冲区? [英] boost serialization vs google protocol buffers?

查看:125
本文介绍了boost序列化与谷歌协议缓冲区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有这些图书馆经验的人有没有评论他们喜欢哪一个?使用时是否有任何性能差异或困难?

Does anyone with experience with these libraries have any comment on which one they preferred? Were there any performance differences or difficulties in using?

推荐答案

我对这两个系统都玩了一些,一些简单的hackish东西,但我觉得你应该如何使用这些库有一个真正的区别。

I've played around a little with both systems, nothing serious, just some simple hackish stuff, but I felt that there's a real difference in how you're supposed to use the libraries.

使用boost :: serialization,你写你自己的结构/ classes,然后添加归档方法,但是你仍然有一些漂亮的苗条类,可以用作数据成员,继承,无论如何。

With boost::serialization, you write your own structs/classes first, and then add the archiving methods, but you're still left with some pretty "slim" classes, that can be used as data members, inherited, whatever.

使用协议缓冲区,即使是一个简单的结构,生成的代码量也是相当大的,生成的结构和代码更适用于操作,并且使用协议缓冲区的功能将数据传输到您自己的内部结构。

With protocol buffers, the amount of code generated for even a simple structure is pretty substantial, and the structs and code that's generated is more meant for operating on, and that you use protocol buffers' functionality to transport data to and from your own internal structures.

这篇关于boost序列化与谷歌协议缓冲区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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