Zstandard (RFC 8878) is well-positioned to replaced GZIP (RFC 1952) as the de-facto compression format.
Zstandard:
Given the likely ubiquitous place Zstandard is going have in the future, I propose first-class adoption of Zstandard in the stdlib.
Existing Go implementations:
Some goals for this package:
- The API be simple and similar to existing packages like
compress/gzip.
- It does not use
unsafe or assembly similar to the existing compress package.
- Performance is always nice, but Go community surveys consistently shows security as more important than performance.
- Users who just need a decently fast enough Zstandard implementation can use
compress/zstd, while those want the best performance and/or advanced features of Zstandard can use @klauspost's package. Any stdlib packages (e.g., net/http that make use of compress/zstd should make it possible to swap over to a different zstd implementation).
- Note that the same is already true of
compress/gzip, which is generally good enough (although there is still room for performance optimizations), but power users can use github.com/klauspost/compress/gzip, which is much faster (as it makes use of assembly).
We could:
- adopt @klauspost's pure-Go (i.e., no assembly) implementation with a cleaned-up API
- extend @ianlancetaylor's work to support compressing
- do a combination of both
Related issues:
Zstandard (RFC 8878) is well-positioned to replaced GZIP (RFC 1952) as the de-facto compression format.
Zstandard:
Given the likely ubiquitous place Zstandard is going have in the future, I propose first-class adoption of Zstandard in the stdlib.
Existing Go implementations:
unsafeor assembly.Some goals for this package:
compress/gzip.unsafeor assembly similar to the existing compress package.compress/zstd, while those want the best performance and/or advanced features of Zstandard can use @klauspost's package. Any stdlib packages (e.g.,net/httpthat make use ofcompress/zstdshould make it possible to swap over to a differentzstdimplementation).compress/gzip, which is generally good enough (although there is still room for performance optimizations), but power users can use github.com/klauspost/compress/gzip, which is much faster (as it makes use of assembly).We could:
Related issues:
Content-Encoding: zstdtohttp.DefaultTransport#62492