As I was preparing the next release of a side project of mine I thought it would be a good moment to measure and compare the size of the resulting binaries using 1.6.3 vs using 1.7rc5 (latest version available at that moment).
The result has been a 24% decrease in binary sizes for x86-64 architectures, 15% for x86 architectures and 13% for arm. Details can be found in the table below.
os-cpu | 1.6.3 | 1.7rc5 | Binary size decrease |
---|---|---|---|
dry-darwin-amd64 | 9666128 | 7321376 | 24,26% |
dry-freebsd-amd64 | 9670081 | 7350169 | 23,99% |
dry-linux-amd64 | 9666625 | 7333489 | 24,14% |
dry-windows-amd64 | 9664000 | 7298048 | 24,48% |
dry-darwin-386 | 7629836 | 6464384 | 15,27% |
dry-freebsd-386 | 7603305 | 6457457 | 15,07% |
dry-linux-386 | 7652591 | 6473134 | 15,41% |
dry-windows-386 | 7690752 | 6481920 | 15,72% |
dry-freebsd-arm | 7621922 | 6647331 | 12,79% |
dry-linux-arm | 7613761 | 6617809 | 13,08% |
Sizes are in bytes. The build was done on Mac OS X.
Good job, Go team!
评论:
anxiousalpaca:
monch0:at first i thought there was a size increase, because of the negative decrease in the table.
anxiousalpaca:Hmm I see.
What will make it easier to understand? Removing the negative sign? maybe better wording in the column header?
monch0:either naming the column just "Binary Size" or omitting the negative sign will do. just fyi to avoid confusion, thanks for the results!
waywardcoder:done, thanks!
karma_vacuum123:I saw similar size decreases on amd64, and one computation-heavy app I had was almost twice as fast. I think the SSA compiler definitely helped me there.
andradei:probably the metric i care about the least, but still, numbers are going in the right direction!
b4ux1t3:So true. Still, compilation time, and GC time are also going down from what I heard.
Would be nice to see some numbers in the same layout as this one, but they would be harder to get.
Yojihito:Challenge accepted!
NOTE: I have a spotty delivery record.
b4ux1t3:RC6 is out, use that :).
lazy_jones:I feel like that's good advice just in general.
I've done a bunch of testing, and basically, while I'm getting no consistent or reliable times, in general the builds from RC5 and RC6 are just faster. The problem is, I'm getting weird, random short build times in 1.6.3 that usually don't beat RC5 or RC6 times, but do it often enough that it's annoying.
I don't know what's wrong. All my builds are on identical VMs with no other activity. I'm super confused as to where my test could be going wrong.
Frakturfreund:How does a comparison of stripped binaries look?
By the way, this happens when I attempt to strip binaries compiled with a relatively recent Go version:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: symbols referenced by indirect symbol table entries that can't be stripped in: /Users/user/XXX _malloc ___error ...
gmallard:
strip -s
works under Linux with go1.7rc6, so it’s probably a macOS specific problem.
The change is impressive. I am getting better than is shown. Example:
From: go1.6.3 -> go1.7rc6
485890(bytes) -> 239628(bytes)
For what it is worth:
AMD Phenom(tm) II X6 1055T Processor Ubuntu 14.04.5 LTS
