golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.2k stars 17.57k forks source link

all: Binary release compression formats #42438

Open jfcg opened 3 years ago

jfcg commented 3 years ago

.gz and .zip formats are quite behind .7z in terms of compression ratio. Extracted linux and windows 1.15.4 binary releases are compressed by %30+ more (default commandline, on Manjaro, p7zip 16.02-6 package):

tar xf go1.15.4.linux-amd64.tar.gz
7za a go-1.15.4.7z go
tar -cJf go-1.15.4.txz go
# etc.

ls -lh go*{gz,zip,7z,xz}
 81M Nov  7 13:27 go-1.15.4.7z
 84M Nov  8 00:15 go-1.15.4.txz
116M Nov  6 01:31 go1.15.4.linux-amd64.tar.gz

 90M Nov  7 14:06 go-1.15.4-win.7z
 92M Nov  8 00:16 go-1.15.4-win.txz
133M Nov  7 14:03 go1.15.4.windows-amd64.zip

7z is widely used & available on all platforms and provides %3 better compression than xz with default parameters. I propose to switch to it for all archive formats. Thanks..

Note: Updated to add xz comparison.

martisch commented 3 years ago

I would suggest to not mix multiple proposals into a single issue but to create separate issues. This allows to focus discussions on each issue and also aligns with the proposal process accepting proposals by labeling the whole issue.

While 7z may be available in general I think it is not in base installations of e.g. MacOS and Windows so this would introduce an additional dependency to bootstrap Go when switching away from gz or zip.

If choosing another compression algorithm or container format to reduce download size. Why is 7z preferable over e.g. xz which is used by other programming languages (pythong, zig, ...) that provide gz and xz but not 7z.