JSON、Protocol Buffers、Thrift 的效率比較

Google 翻資料,結果三月初的時候有人試著 benchmark,結果還蠻讓人意外:「Performance comparison of Thrift, JSON and Protocol Buffers」。

結論是 JSON 在速度上不會輸給 Protocol BuffersThrift。討論出來的原因是因為 Protocol Buffers 與 Thrift 的功能比 JSON 多出太多。

不過我應該會用 JSON 寫東西吧,畢竟是個 open standard...

3 thoughts on “JSON、Protocol Buffers、Thrift 的效率比較”

  1. mclee says:

    Facebook or Google 當然也會想用 open standard。不過他們當然有不能用 json 的原因。

    JSON should be good for you when you dont have their burdens.

  2. kcwu says:

    thread 一開始的 benchmark 是在 python 做的 (都用 pure python implementation). 但有 c extension lib 才是關鍵. 後面有人講到 perl 有 xs 版, protobuf 就差不多甚至更快. 但在 python 上, json 有 c extension, 但 protobuf 沒有, 速度就差了幾十倍.

  3. vv says:

    open standard 是啥?

    能吃嗎?

Leave a Reply

Your email address will not be published. Required fields are marked *