Biggest differences of Thrift vs Protocol Buffers?

前端 未结 15 1604
無奈伤痛
無奈伤痛 2020-11-30 15:59

What are the biggest pros and cons of Apache Thrift vs Google\'s Protocol Buffers?

相关标签:
15条回答
  • 2020-11-30 16:48

    I was able to get better performance with a text based protocol as compared to protobuff on python. However, no type checking or other fancy utf8 conversion, etc... which protobuff offers.

    So, if serialization/deserialization is all you need, then you can probably use something else.

    http://dhruvbird.blogspot.com/2010/05/protocol-buffers-vs-http.html

    0 讨论(0)
  • 2020-11-30 16:48

    And according to the wiki the Thrift runtime doesn't run on Windows.

    0 讨论(0)
  • 2020-11-30 16:49
    • Protobuf serialized objects are about 30% smaller than Thrift.
    • Most actions you may want to do with protobuf objects (create, serialize, deserialize) are much slower than thrift unless you turn on option optimize_for = SPEED.
    • Thrift has richer data structures (Map, Set)
    • Protobuf API looks cleaner, though the generated classes are all packed as inner classes which is not so nice.
    • Thrift enums are not real Java Enums, i.e. they are just ints. Protobuf has real Java enums.

    For a closer look at the differences, check out the source code diffs at this open source project.

    0 讨论(0)
提交回复
热议问题