By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: How Datadog Cut the Size of Its Agent Go Binaries by 77%
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > News > How Datadog Cut the Size of Its Agent Go Binaries by 77%
News

How Datadog Cut the Size of Its Agent Go Binaries by 77%

News Room
Last updated: 2026/03/10 at 5:04 PM
News Room Published 10 March 2026
Share
How Datadog Cut the Size of Its Agent Go Binaries by 77%
SHARE

After the Datadog Agent grew from 428 MiB to 1.22 GiB over a period of 5 years, Datadog engineers set out to reduce its binary size. They discovered that most Go binary bloat comes from hidden dependencies, disabled linker optimizations, and subtle behaviors in the Go compiler and linker.

This growth impacted both us and our users: network costs and resource usage increased, perception of the Agent worsened, and it became harder to use the Agent on resource-constrained platforms.

To address this, Datadog software engineer Pierre Gimalac wrote, their approach consisted in auditing imports, isolating optional code, and eliminating reflection/plugin pitfalls to shrink binaries as much as possible.

Indeed, after analyzing the Agent’s growth, Datadog engineers found out it was driven by new features, additional integrations, and large third-party dependencies (e.g., Kubernetes SDKs). In particular, Go’s dependency model includes transitive imports, making it so that even a small change can pull in hundreds of packages.

Datadog engineers devised two practical ways to remove unnecessary dependencies: using build tags (//go:build feature_x) to exclude optional code, and moving code into separate packages so that non-optional packages remain as small as possible. Both techniques required systematically auditing imports to identify which files or packages could be excluded from a given build. For example, simply moving one function into its own package removed ~570 packages and ~36 MB of generated code from a binary not using it.

Auditing dependencies is not an easy task, but the Go ecosystem provides three useful tools to help: go list, which lists all packages used in a build; goda, which visualizes dependency graphs and import chains to help understand why a given dependency is required; and go-size-analyzer, which shows how much space each dependency contributes to a binary.

Besides dependency optimization, Datadog engineers got an additional 20% size reduction by minimizing the use of reflection, which can silently disable some linker optimizations, including dead-code elimination:

if you use a non-constant method name, the linker can no longer know at build time which methods will be used at runtime. So it needs to keep every exported method of every reachable type, and all the symbols they depend on, which can drastically increase the size of the final binary.

To address this issue, they eliminated dynamic reflection where possible, both in their codebase and in dependencies. The latter step required submitting several PRs to projects such as kubernetes/kubernetes, uber-go/dig, google/go-cmp and others.

Another feature that disables dead-code elimination is Go plugins, a mechanism that enables a Go program to dynamically load Go code at runtime. In fact, simply importing the plugin package causes the linker to treat the binary as dynamically linked, “which disables method dead code elimination and even forces the linker to keep all unexported methods”. This change yielded an additional ~20% reduction in some builds.

As a final note, Gimalac emphasizes that these improvement were achieved over a six month period and, most importantly, did not require removing any feature. His account includes much more detail than can be covered here, so be sure to read it to get the full story.

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article  68% of Nigeria’s 2025 music streaming was led by three companies  68% of Nigeria’s 2025 music streaming was led by three companies
Next Article It’s (pretty much) confirmed: Motorola will be the star of the foldable market this year It’s (pretty much) confirmed: Motorola will be the star of the foldable market this year
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

Google To Impose 24-Hour Safety Wait To Activate Android App Sideloading
Google To Impose 24-Hour Safety Wait To Activate Android App Sideloading
News
How to Create a Content Marketing Strategy in 2026
How to Create a Content Marketing Strategy in 2026
Computing
iOS 26.4 arrives in days. 3 features we’re excited about
iOS 26.4 arrives in days. 3 features we’re excited about
News
Can you pass this 2 minute phone test? 70% of Americans can’t
Can you pass this 2 minute phone test? 70% of Americans can’t
News

You Might also Like

Google To Impose 24-Hour Safety Wait To Activate Android App Sideloading
News

Google To Impose 24-Hour Safety Wait To Activate Android App Sideloading

8 Min Read
iOS 26.4 arrives in days. 3 features we’re excited about
News

iOS 26.4 arrives in days. 3 features we’re excited about

3 Min Read
Can you pass this 2 minute phone test? 70% of Americans can’t
News

Can you pass this 2 minute phone test? 70% of Americans can’t

6 Min Read
A Die Hard Movie Led To A Real-Life FBI Investigation – BGR
News

A Die Hard Movie Led To A Real-Life FBI Investigation – BGR

5 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?