Datadog
Datadog logoDatadog · Feature trail

Go Map Memory Optimization

1 post · Jul 2025

What this trail covers

Datadog's Go Agent binaries have undergone significant size reductions, decreasing by up to 77% through systematic dependency auditing, targeted refactors, and re-enabling linker optimizations. This effort involved analyzing build tag usage, isolating dependencies into separate packages, and leveraging tools like `go list` and `goda` for dependency graphing. The project also led to contributions to the Go toolchain and improvements for other large Go projects like Kubernetes. This post details how Go 1.24's Swiss Tables implementation reduced memory usage in a large in-memory map, showing how Datadog profiled and sized the change, and sharing struct-level optimizations that led to even larger fleet-wide savings.

All Datadog trails