Conversation
This patch improves compile times from ~3.5s to ~2.0s on my linux machine. Additionally, some benchmarks have shown that prost is also faster than protobuf at decoding: georust/geozero#118 (comment) This patch changes the signature of the `Error` type. prost doesn't expose a way to write directly to a `std::io::Write`, so this makes `Tile::write_to` write to a `Vec` first. Some generated fields are now options, while others aren't anymore. It doesn't show in the public API. protobuf's `compute_size` seemed to include the length delimiter while prost's `encoded_len` does not. However, the encoding was always done without the length delimiter, so it makes more sense to not include it? If you want backwards compatibility it can be easily added.
|
This seems like the way to go, since the protobuf crate is no longer maintained. Thanks! I tested the Output with v0.12: Output with prost: I haven't looked into it too deeply, but maybe these are two different ways of encoding the same data. Any ideas? |
|
Yeah prost encodes fields by ascending tag values: while protobuf encodes them by the order in which they appear in the proto file: so the version ( |
Hey, i'd like to improve the compile time of a project using mvt https://github.com/OpenRailAssociation/osrd/tree/dev/editoast The project uses prost for other reasons, so i'd like to change mvt's protocol buffers implementation to prost if it's alright...
This patch improves compile times from ~3.5s to ~2.0s on my linux machine. Additionally, some benchmarks have shown that prost is also faster than protobuf at decoding:
georust/geozero#118 (comment)
This patch changes the signature of the
Errortype.prost doesn't expose a way to write directly to a
std::io::Write, so this makesTile::write_towrite to aVecfirst.Some generated fields are now options, while others aren't anymore. It doesn't show in the public API.
protobuf's
compute_sizeseemed to include the length delimiter while prost'sencoded_lendoes not. However, the encoding was always done without the length delimiter, so it makes more sense to not include it? If you want backwards compatibility it can be easily added.