A small sample of smaller binaries using go 1.7

agolangf · 2016-08-10 21:00:01 · 541 次点击    
这是一个分享于 2016-08-10 21:00:01 的资源,其中的信息可能已经有所发展或是发生改变。

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:

at first i thought there was a size increase, because of the negative decrease in the table.

monch0:

Hmm I see.

What will make it easier to understand? Removing the negative sign? maybe better wording in the column header?

anxiousalpaca:

either naming the column just "Binary Size" or omitting the negative sign will do. just fyi to avoid confusion, thanks for the results!

monch0:

done, thanks!

waywardcoder:

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.

karma_vacuum123:

probably the metric i care about the least, but still, numbers are going in the right direction!

andradei:

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.

b4ux1t3:

Challenge accepted!

NOTE: I have a spotty delivery record.

Yojihito:

RC6 is out, use that :).

b4ux1t3:

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.

lazy_jones:

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
...
Frakturfreund:

strip -s works under Linux with go1.7rc6, so it’s probably a macOS specific problem.

gmallard:

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


入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

541 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传