Use better gzip/deflate #343
Labels
enhancement
New feature or request
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
The standard library is more interested in maintaining status quo than improving compression.
I maintain a compression package that seems more suited to Hertz. It plugs in without any modifications, by simply replacing imports.
Below is a comparison between my package and the standard library, using 4GB of mixed web content:
The standard library is poorly balanced, so levels 6-8 have very little difference. This is more spread out so the actual level reflects an increase in compression. Here is the compression/speed tradeoff visualized:
The package uses no cgo or "unsafe" code.
TLDR; With level 6 (default in your setup), you get 2.1x the throughput at 2.7% more output on the wire, with better options to tweak speed/compression.
Describe the solution you'd like
Replace gzip/flate imports with corresponding packages.
Additional context
The package also provides stateless compression modes which can be useful for long-running requests with little data throughput.
Each Write will be compressed immediately without any state being retained between calls. I don't know if this has any use here.
The text was updated successfully, but these errors were encountered: