msgpack 真的比 protobuf buffers 快 4 倍吗?
hprose serialize Runtime:0.2334s
json encode Runtime:15.2883s
serialize Runtime:0.7090s
msgpack_pack Runtime:0.6883s
hprose unserialize Runtime:0.5439s
json decode Runtime:24.2921s
unserialize Runtime:1.0243s
msgpack_unpack Runtime:1.4011s
hprose serialize/unserialize Runtime:1.1161s
json encode/decode Runtime:41.0092s
serialize/unserialize Runtime:1.9804s
msgpack pack/unpack Runtime:2.2908s
json encode Runtime:15.2883s
serialize Runtime:0.7090s
msgpack_pack Runtime:0.6883s
hprose unserialize Runtime:0.5439s
json decode Runtime:24.2921s
unserialize Runtime:1.0243s
msgpack_unpack Runtime:1.4011s
hprose serialize/unserialize Runtime:1.1161s
json encode/decode Runtime:41.0092s
serialize/unserialize Runtime:1.9804s
msgpack pack/unpack Runtime:2.2908s
在 PHP 中的实际测试结果是,hprose 的序列化和反序列化速度都比msgpack要快,总体速度快1倍,如果 msgpack 真的比 protocol Buffers 快 4 倍的话,那 hprose 比 protocol Buffers 要快 8 倍。而 hprose 还提供了比 GRPC 方便的多的 RPC 功能,那 msgpack 和 protocol Buffers 还有什么优势呢?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
hprose +10086
hprose 的引用存储方式比 msgpack 单纯的二进制存储方式,更省空间呢。
msgpack是二进制存取的,主要优点是数据量小吧