This PR implements a series of optimizations to try to reduce the amount of generated code with the aim of speeding up compilation. Altogether this makes our slowest proto crate a bit over 10% faster to compile (~41s to ~35s).
The changes, in separate commits, are:
Codify the three separate cases for deserialization (packed repeated, length-delimited, non-length-delimited) into helper functions
Move into_known for open enums into the OpenProtoEnum trait, then use it to default-impl the other methods of that trait
Add special-cased helper functions for the common case of serializing (and compute_size-ing) non-optional proto3 scalar fields
Iterate optional fields using if let instead of for
Skip compute_grpc_slices_size calls/impls for fields/types where we know statically that no Lazy<> fields are present. This uses the SCC analysis.
Depends on #157.
This PR implements a series of optimizations to try to reduce the amount of generated code with the aim of speeding up compilation. Altogether this makes our slowest proto crate a bit over 10% faster to compile (~41s to ~35s).
The changes, in separate commits, are:
into_known
for open enums into theOpenProtoEnum
trait, then use it to default-impl the other methods of that traitif let
instead offor
compute_grpc_slices_size
calls/impls for fields/types where we know statically that no Lazy<> fields are present. This uses the SCC analysis.