首页 > 资讯列表 > 编程/数据库 >> PHP

php MessagePack使用介绍

PHP 2014-12-31 22:24:08 转载来源: 网络整理/侵权必删

本文为大家讲解的是php MessagePack使用介绍,感兴趣的同学参考下. 1,今天在hacknews上看到很多人对messagepack的争论。首先了解什么是MessagePack:MessagePack is a binary-based efficient object serialization library. It enables to exchange structured objects between many languages like JSON. But unlike JSON, it is very fast and small. 2,MessagePack的主要用途,作者解释说有两大用途:一是Space-efficient storage for Memcache entries (Pinterest),节省空间类型的mamcache应用;另一个是用于RPC传输, This use case is fairly close to my original intent. When one is designing an RPC syst

本文为大家讲解的是php MessagePack使用介绍,感兴趣的同学参考下.

1,今天在hacknews上看到很多人对messagepack的争论。首先了解什么是MessagePack:MessagePack is a binary-based efficient object serialization library. It enables to exchange structured objects between many languages like JSON. But unlike JSON, it is very fast and small.

2,MessagePack的主要用途,作者解释说有两大用途:一是Space-efficient storage for Memcache entries (Pinterest),节省空间类型的mamcache应用;另一个是用于RPC传输, This use case is fairly close to my original intent. When one is designing an RPC system, one of the first tasks is to specify and implement a communication protocol. This process can get pretty hairy as you need to worry about a lot of low-level issues like Endian-ness. By using MessagePack, one can skip designing and implementing a communication protocol entirely and accelerate development.

3,争议的地方是MessagePack的benchmark说,他比protocolBuffer,Json快很多倍。但是有人不相信,做个javasript下的测试(json与messagePack)。发现MessagePack仅是压缩后的数据比json少10%左右,而压缩和解压时间则和json的解析器比起来要费时很多。

4,“MsgPack vs. JSON: Cut your client-server exchange traffic by 50% with one line of code”这篇文章使用了messagePack做服务器的优化,降低服务器的数据量,更加合理的利用带宽。作者强调了他们宁愿浪费客户端的0.5ms—1ms,但是服务器使用ruby的MessagePack解析器,效率能够比JSON快5倍。

The difference to MessagePack官方网站

2,MsgPack vs. JSON: Cut your client-server exchange traffic by 50% with one line of code

HN评论地址:http://news.ycombinator.com/item?id=4090831

3,My thoughts on MessagePack

HN评论地址:http://news.ycombinator.com/item?id=4092969

4 JS下MessagePack与JSON性能对比

HN评论地址:http://news.ycombinator.com/item?id=4091051


标签: php MessagePack 使用 介绍


声明:本文内容来源自网络,文字、图片等素材版权属于原作者,平台转载素材出于传递更多信息,文章内容仅供参考与学习,切勿作为商业目的使用。如果侵害了您的合法权益,请您及时与我们联系,我们会在第一时间进行处理!我们尊重版权,也致力于保护版权,站搜网感谢您的分享!

站长搜索

http://www.adminso.com

Copyright @ 2007~2024 All Rights Reserved.

Powered By 站长搜索

打开手机扫描上面的二维码打开手机版


使用手机软件扫描微信二维码

关注我们可获取更多热点资讯

站长搜索目录系统技术支持