hyperium / tonic

A native gRPC client & server implementation with async/await support.
https://docs.rs/tonic
MIT License
9.8k stars 998 forks source link

Allow specifying compression encoding order preference #1727

Closed CapCap closed 3 months ago

CapCap commented 3 months ago

Motivation

Although Zstd is significantly more performant (> 5x in our testing), the default chosen encoding remains Gzip when both are enabled. This blocks us from being able to gradually roll out zstd support for existing downstream clients before disabling Gzip entirely.

Solution

This PR introduces a feature that allows for specifying the order of compression encodings. The key changes include:

The behavior is now "given a list of supported encodings, I will pick the highest priority one that I support"

LucioFranco commented 3 months ago

@CapCap I ran CI looks like there are some failures, can you address those and then ping me again when its ready for review and CI is passing? thanks

djc commented 3 months ago

@CapCap we merged #1757 which is substantially similar to this -- hope that's okay and that it address your issues. If not, please open an issue so we can discuss in more detail what you need.