Skip to content

compress/zstd: add new package #62513

Open
@dsnet

Description

@dsnet

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:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Accepted

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions