Avro与Protobuf性能对比
所用Schema
Avro所用Schema
{"namespace": "test.avro",
"type": "record",
"name": "User",
"fields": [
{"name": "i", "type": ["int","null"]},
{"name": "l", "type": ["long", "null"]},
{"name": "s", "type": ["string", "null"]},
{"name":"b","type":["boolean","null"]}
]
}
Protobuf所用Schema
message SomeData {
optional int32 i = 1;
optional int64 l = 2;
optional string s = 3;
optional bool b=4;
}
写出的数据:
{
"i" : random,
"l" : random,
"s" : "never",
"b" : random
}
测试对象:
- 用
protoc</