alecthomas / go_serialization_benchmarks

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

Limitations of the benchmarking #120

Closed chmike closed 2 months ago

chmike commented 11 months ago

This benchmark is a bit comparing apples and oranges as the different encodings don't have the same properties.

Some just serialize the values without any type information (e.g.MUS), some add a type tag to the serialized value (e.g. MessagePack), and others add struct/object type name and field names (e.g. gob, json).

Most serializing package require code generation and some don't (e.g. gob, json).

Some encodings are thus very robust against bugs or malicious data, and some support dynamic value type discovery. This is fine as the best choice depends on the type of usage and their requirements. But this has an impact on the speed and the encoded data size of the respective encoder/decoders.

A first suggestion is to add a table in the README listing the properties of the different packages.

A second suggestion is to group benchmarks by properties so that we don't compare apples with oranges.

alecthomas commented 11 months ago

Seems reasonable. If you'd like to contribute this change I'd accept it.

alecthomas commented 2 months ago

No contributions, closing.