alecthomas / go_serialization_benchmarks

Benchmarks of Go serialization methods
https://alecthomas.github.io/go_serialization_benchmarks/
1.56k stars 158 forks source link

Add apache thrift #101

Closed ii64 closed 3 months ago

ii64 commented 2 years ago

Apache Thrift v0.15.0

ii64 commented 2 years ago

Somehow the JSON protocol seems buggy (check json unmarshal test), the rests are fine (TCompact, TBinary)

ii64 commented 2 years ago

Look: TMemoryBuffer uses bytes.Buffer , the Close() method calls bytes.Buffer.Reset so that it can be used for next operation but it turns out the result .Bytes() giving empty byte slice https://github.com/apache/thrift/blob/e27e82c46ba4/lib/go/thrift/memory_buffer.go#L68-L71 image

Meanwhile TCompact: image

and TBinary: image

ii64 commented 2 years ago

Ok forgot to add the .Flush method call