TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

My thoughts on MessagePack

131 点作者 frsyuki将近 13 年前

8 条评论

ynniv将近 13 年前
cheald has an excellent comment regarding MessagePack, JSON, and Protocol Buffers in the post from 15 hours ago: <a href="http://news.ycombinator.com/item?id=4091051" rel="nofollow">http://news.ycombinator.com/item?id=4091051</a><p><pre><code> MessagePack is not smaller than gzip'd JSON MessagePack is not faster than JSON when a browser is involved </code></pre> Other comments from that post include:<p><pre><code> MessagePack is not human readable MessagePack has issues with UTF-8 Small packets also have significant TCP/IP overhead </code></pre> Really, anyone who hasn't read the other comments should: <a href="http://news.ycombinator.com/item?id=4090831" rel="nofollow">http://news.ycombinator.com/item?id=4090831</a>
评论 #4093193 未加载
评论 #4093152 未加载
评论 #4093204 未加载
shykes将近 13 年前
Zerorpc (<a href="http://github.com/dotcloud/zerorpc-python" rel="nofollow">http://github.com/dotcloud/zerorpc-python</a>) uses msgpack as its primary serialization format. Among other things it is significantly more efficient for floating point data. At dotCloud we use it to move many millions of system metrics per day, so it adds up. Also worth noting: msgpack maps perfectly to json, so there's nothing keeping you from translating it to json on its way to the browser, where json is indeed a better fit. In practice this doesn't affect performance since you typically need to parse and alter the message at the browser boundary anyway, for some sort of access control.
frsyuki将近 13 年前
We're using MessagePack in a Rails application to log user behaviors and analyze them.<p>Compared with other serialization libraries such as Protocol Buffers, Avro or BSON, one of the advantages of MessagePack is compatibility with JSON. (In spite of its name, BSON has special types which cause incompatibility with JSON)<p>It means we can exchange objects sent from browsers (in JSON format) between servers written in different languages without losing information.<p>I will not use MessagePack with browsers but it's still useful to use it with web applications.
评论 #4093355 未加载
dkhenry将近 13 年前
As much as we would like to jump back on the MessagePack is no JSON alternative here, I would like to commend The author on taking the criticism posted earlier like a mature adult and explaining his point of view. Even admitting that some of the benchmarks might have been misleading.
SeoxyS将近 13 年前
I've personally been using BSON[1] as a binary alternative to JSON, and it's worked out great. I've written an Objective-C wrapper around the C lib, in case anybody's interested. Every other language has a solid implementation from 10gen (the MongoDB guys). It's a solid format with a clear spec that's extensible and fully supports UTF-8.<p>[1]: <a href="http://bsonspec.org/" rel="nofollow">http://bsonspec.org/</a>
评论 #4093481 未加载
samsoffes将近 13 年前
I think it's hilarious that 2 of the 3 comments on the gist are about how he formatted his Markdown. <i>sigh</i><p>I think MessagePack is great. Good for him for trying to make something better. He openly admits it's not better all the time. Why not help?
TheRevoltingX将近 13 年前
Very interesting discussion. I work on a 2D MMORPG for Android. This is extremely relevant to me. I have a few questions though.<p>What if you take compression and deserialization out of the picture? For example, in my server I have a hash like data structure that gets turned into JSON for browsers and byte array for mobile clients.<p>For example, because the data has to be transferred at fast rates and will be going over mobile networks. The size of the packet matters because every millisecond counts.<p>Then to read the data, I simply read the stream of bytes and build the objects I need on the client. This has to happen mostly without allocations for example on Android to avoid the GC.<p>So a few questions: Does deserializing JSON cause any memory allocations? If you're not tokenizing the data and don't need to parse it, will it be a significant gain over s serialized byte protocol or JSON?<p>In any case, I'll experiment on my end and perhaps blog about my own findings.
评论 #4096424 未加载
keithseahus将近 13 年前
The best way of serialization at present. I like the thought, performance and various implementations.
评论 #4093106 未加载
评论 #4093129 未加载