Skip to content

Conversation

@bradfitz
Copy link
Member

@bradfitz bradfitz commented Oct 4, 2025

Saves 233-632 KB from tailscaled.

DO NOT SUBMIT; draft

@bradfitz
Copy link
Member Author

bradfitz commented Oct 4, 2025

233,472 bytes savings for linux/amd64 and -ldflags="-w -s" using this patch ...

bradfitz@bradm4-4 tailscale.com % GOOS=linux GOARCH=amd64 ~/src/github.com/tailscale/go/bin/go build -o after -tags=$(./tool/go run ./cmd/featuretags -min) -ldflags="-w -s" ./cmd/tailscaled
bradfitz@bradm4-4 tailscale.com % GOOS=linux GOARCH=amd64 ./tool/go build -o before -tags=$(./tool/go run ./cmd/featuretags -min) -ldflags="-w -s" ./cmd/tailscaled
% ./tool/go version
go version go1.25.1 darwin/arm64
bradfitz@bradm4-4 tailscale.com % ls -l before after
-rwxr-xr-x@ 1 bradfitz  staff  11718840 Oct  4 10:05 after
-rwxr-xr-x@ 1 bradfitz  staff  11952312 Oct  4 10:05 before
bradfitz@bradm4-4 tailscale.com % python3
Python 3.13.4 (main, Jun  3 2025, 15:34:24) [Clang 17.0.0 (clang-1700.0.13.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 11952312-11718840
233472
>>>
bradfitz@bradm4-4 tailscale.com % git rev-parse HEAD
ec50f8aed939c774a4eaadbd3c9f8f545e81b3d9
bradfitz@bradm4-4 tailscale.com %

(and 335,770 bytes for amd64 without -w -s)

And 632 KB for a full build of tailscaled.

Saves 220-360 KB from tailscaled.

DO NOT SUBMIT; draft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants