Hacker News new | ask | show | jobs
by codazoda 1613 days ago
I originally thought go binaries we’re large. Turns out they can be quite small.

https://joeldare.com/small-go-binaries

3 comments

upx will take time/resource to unzip, which could be slow in some embedded systems.

a helloworld go binary is about 8MB, a C is about 20KB(shared libraries), go binary size adds up really fast due to the fact most do not use shared libraries even when there are many go binaries in the system.

UPX also prevents re-using pages when multiple instances of the executable are loaded in RAM which is bad on low end systems.

The best solution would be to use BTRFS/ZFS with transparent compression (can use fast algorithms) or even SquashFS if you can deploy the entire app image mounted in a directory.

ZFS on low-end low-RAM system? You must be joking...
The binary is 7.3MB before compressing. Still not too big.