why the go install package download from official website of go1.21 is less than go1.20?

244 views
Skip to first unread message

xie cui

unread,
Aug 15, 2023, 11:48:43 PM8/15/23
to golang-nuts

go1.20.7.darwin-arm64.tar.gz
ArchivemacOSARM6492MB

go1.21.0.darwin-arm64.tar.gz
ArchivemacOSARM6462MB
this size reduce about 30%.
why the size reduce a lot?

Kurtis Rader

unread,
Aug 16, 2023, 12:31:41 AM8/16/23
to xie cui, golang-nuts
All of the packages are significantly smaller -- not just those for macOS. So this isn't due to anything specific to the macOS package(s). Looking at the release notes for Go 1.21.0 I don't see an obvious explanation for the reduction. Downloading and extracting those two packages shows the contents have a proportional size difference:

> du -sh go1.20.7/ go1.21.0/
264M go1.20.7/
237M go1.21.0/

Most of the files and directories are larger in the 1.21.0 release. There are some notable exceptions. The main one, accounting for most of the decrease, is the tool directory: This is the `df -k` diff:

< 111520    ./pkg/tool/darwin_arm64
---
> 80704 ./pkg/tool/darwin_arm64

 That is a 3 MB reduction (28%) in the total size of the Go tools. Why are the Go tools so much smaller? I don't see an obvious answer in the release notes.


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/67bb5470-0b40-4a33-9d11-fefa7f6fd7a6n%40googlegroups.com.


--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

Jeremy Cattone

unread,
Aug 16, 2023, 3:46:57 PM8/16/23
to golang-nuts
Looks like on-going work, finally completed in 1.21?

Ian Lance Taylor

unread,
Aug 16, 2023, 4:36:45 PM8/16/23
to Jeremy Cattone, golang-nuts
I think that for 1.21 the biggest difference is that we aren't
including debug info with the binaries in
$GOROOT/pkg/tool/$GOOS_$GOARCH. That change was made in
https://go.dev/cl/475378.

Ian

Ian
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/90e15ffe-a72c-4714-9c66-798bb0ddab70n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages