Go v1.15 does indeed generate smaller binaries

When deploying Go applications to edge devices, we are always trying to minimize binary size as remote updates often travel over Cat-M cellular networks. Thus I was pleasantly surprised with the binary size was slightly smaller with Go 1.15.

Go 1.14

[cbrake@mars go]$ ls -l is_arm 
-rwxr-xr-x 1 cbrake cbrake 11403264 Aug 15 20:57 is_arm
[cbrake@mars go]$ xz is_arm 
[cbrake@mars go]$ ls -l is_arm.xz 
-rwxr-xr-x 1 cbrake cbrake 3322344 Aug 15 20:57 is_arm.xz

Go 1.15

[cbrake@ceres go]$ ls -l is_arm 
-rwxr-xr-x 1 cbrake cbrake 9568256 Aug 15 20:56 is_arm
[cbrake@ceres go]$ xz is_arm 
[cbrake@ceres go]$ ls -l is_arm.xz 
-rwxr-xr-x 1 cbrake cbrake 2733652 Aug 15 20:56 is_arm.xz

17.7% reduction in size – every little bit helps. With the above binary, we recently switch to Nats.io for communication, but there are still some tangled dependencies pulling in net/http. Once those get sorted out, size will probably go down another 1/2M or so.

1 Like