CONCEPT Cited by 1 source
Binary-size bloat¶
Binary-size bloat is the monotonic growth of a compiled artifact over time as features + dependencies accumulate, without a commensurate removal discipline. It's a "nobody's fault" bug: every individual commit adds a little, nobody's PR is obviously unreasonable, and the artifact size curve compounds.
Why it matters¶
- Network costs and transfer time balloon (cloud billing, slow bootstraps).
- Resource usage grows even when you don't use the new features — RSS + executable pages are a function of binary size.
- Deployability shrinks — size-sensitive targets (serverless platforms, IoT devices, containerized workloads with tight image layer budgets) stop working.
- Developer perception worsens, "harder to use the Agent on resource-constrained platforms" (Datadog 2026-02-18).
Canonical datum¶
Datadog Agent Linux amd64 .deb:
| Version | Compressed | Uncompressed |
|---|---|---|
| 7.16.0 (2019) | 126 MiB | 428 MiB |
| 7.60.0 (Dec 2024) | 265 MiB | 1,248 MiB |
+110 % compressed, +192 % uncompressed over 5 years — every component (features, dependencies, build matrix) growing together with no counterweight.
Mechanisms (Go-specific, but transferable)¶
- Transitive-dependency reachability. A single direct import drags its full transitive closure into the binary (concepts/transitive-dependency-reachability). Adding a trivial helper can pull tens of MiB of unrelated library code if that helper's package happens to import it.
- Dead-code-elimination defeat. The
linker's DCE pass only prunes what it can
prove is unused. Any code that makes static proof impossible
— e.g.
reflect.MethodByName(concepts/reflect-methodbyname-linker-pessimism), importingplugin(concepts/go-plugin-dynamic-linking-implication) — forces retention of everything. - Accidental imports. A dependency's
init()function or global-variable side effects can force symbol retention even when the declared API surface isn't used.
Cure: audit + prune¶
Datadog's 2026-02-18 program cut the Agent by up to 77 % over 6 months without removing any features. The recipe is measurement-driven:
- Map the binary:
go list -f '{{ .Deps }}'+ systems/goda (why each dep) + systems/go-size-analyzer (byte cost). - Prune at the edge: build tags exclude files + their imports; move single offending functions into their own packages.
- Re-enable DCE by patching
reflect.MethodByName
sites and removing unused
pluginimports. - Upstream the fixes so everyone benefits and no long-lived fork is maintained.
Result¶
Agent binaries shrank 56-77 %; .deb package halved. Features
preserved. Kubernetes — picking up Datadog's method-DCE
enablement — reports 16-37 % on its own binaries.
Seen in¶
- sources/2026-02-18-datadog-how-we-reduced-agent-go-binaries-up-to-77-percent — canonical wiki instance: 5-year growth + 6-month cure.