4 ms·
tl;dr for those wondering: strip debugging and then compress the binary with upx: go build -ldflags="-s -w" main.go upx --brute main Just tried that o
by ed25519FUUU 6y ago
tl;dr for those wondering: strip debugging and then compress the binary with upx:
go build -ldflags="-s -w" main.go
upx --brute main
Just tried that on one of my binaries and went from 12 mB down to 3.6 mB.
- jaytaylor 6y agoWhat about process startup time?
- distortedsignal 6y agoI tried to answer upthread (https://news.ycombinator.com/item?id=23912394 https://news.ycombinator.com/item?id=23912394), but the long and short of it is that it takes about 3x longer to start the program for my example (35 MB no compression, 27 MB after ldflags="-s -w", 8 MB after UPX) after UPX compression than before.