Show HN: Shed Light on Your Go Binary Bloat with Go Size Analyzer (github.com)
I've created a powerful tool to help Go developers uncover the hidden giants in their compiled binaries. Go Size Analyzer is like an X-ray machine for your Go executables, revealing:
Which dependencies are eating up your binary size
Unexpected bloat from standard library or vendor packages
Size changes between binary versions with a visual diff
Key features that set it apart:
Interactive treemap visualizations (check out the demo: https://gsa.zxilly.dev)
Slick terminal UI for deep diving into package hierarchies
Cross-platform support (works on Linux, macOS, and Windows binaries)
Export to SVG for easy sharing and documentation or just visualize the CI process
Whether you're optimizing for edge devices, reducing Docker image sizes, or just curious about what's really inside your Go binaries, this tool provides detailed insights. .
14 comments
[ 2.8 ms ] story [ 53.2 ms ] threadI love how the Kubernetes client for Go is always the culprit for adding dozens of megabytes to binary sizes. Thankfully, its impact on binary size is decreasing as the codebase adopts generics.
Out of curiosity, how well does this work with stripped binaries? Many people interested in reducing binary size will often strip debug symbols and add "-a -s" to LDFLAGS, so what identifying information of a package is left in a binary? Besides VCS information (unless the binary was also built with -buildvcs=false so Git commit hashes aren't baked into the binary).
On Windows, there's SizeBench[0] but it doesn't work on macOS and non-PE files, and I miss having a tool like that.
[0]: https://github.com/microsoft/SizeBench, likely used to be an internal tool that was open-sourced
Thank you both.
I noticed that https://www.jackyoustra.com/binary appears to fail with 'Reference Error: Can't find variable: SharedArrayBuffer' on Safari when you give it a binary.
On Firefox, it does not display the size of sections unless you hover the cursor. Not sure if it's intended - just noting here.
That is intended behavior, but looking back seems kind of silly? I'll fix!
0. https://code.rocket9labs.com/tslocum/boxcars
(for the container image size analysis I used dive, available here https://github.com/wagoodman/dive)