go_serialization_benchmarks icon indicating copy to clipboard operation
go_serialization_benchmarks copied to clipboard

Limitations of the benchmarking

Open chmike opened this issue 1 year ago • 1 comments

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.

chmike avatar Oct 05 '23 07:10 chmike

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

alecthomas avatar Oct 05 '23 07:10 alecthomas

No contributions, closing.

alecthomas avatar Jun 09 '24 23:06 alecthomas