Skip to content

Compilers

CC

CPU Features

Test what features whould be enabled by -march=native:

gcc -march=native -Q --help=target
clang -march=native -E -v - </dev/null 2>&1 | grep cc1

Go

Binary size

Strip debug symbols and tables to reduce size significantly:

CGO_ENABLED=0 go build -ldflags="-s -w" -o mybinary

Disabling function inlining and/or bounds checking may reduce the size:

CGO_ENABLED=0 go build -ldflags="-s -w" -gcflags=all="-l -B" -o mybinary

References: