Skip to content

cmd/distpack: offer Zstandard-compressed archives in addition to gzip #62446

Open
@cespare

Description

@cespare

This is inspired by #62445, where @dsnet proposes using zopfli to create ~6% smaller .gz downloads for Go release downloads.

As he writes in that issue:

zstd is well-positioned to take over as the defacto compression format, but that probably won't happen for another decade.

This proposal is to help usher in that future by offering zstd downloads in addition to gzip.

Here's a very quick'n'dirty comparison of compression performance on the same go1.21.0.linux-amd64.tar.gz archive Joe looked at:

file size cmp ratio vs. orig CPU time
.tar 223.0 MB
orig .gz 66.7 MB 29.9% 5-7s1
gzip -9 65.6 MB 29.4% -1.6% 20s
zopfli .gz 62.6 MB 28.1% -6.1% 15min on Joe's machine
zstd 3 63.6 MB 28.5% -4.6% 800ms
zstd 7 58.4 MB 26.2% -12.4% 2.4s
zstd 12 52.0 MB 23.3% -22.0% 7.7s
zstd 19 44.5 MB 20.0% -33.3% 64s

Also, decompressing the .zst archives takes about 4x less CPU time than decompressing the .gz archives on my machine.

If we offered .gz and .zst, people who care at all about size and speed can just use .zst and get a much bigger benefit than if we had zopfli-encoded .gzs.

Footnotes

  1. This is an estimate based on the fact that the file size falls between gzip -5 and gzip -6. I think that the actual release process uses compress/gzip which is quite a bit slower.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Accepted

    Status

    Planned

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions