[HN Gopher] Show HN: Shed Light on Your Go Binary Bloat with Go ...
___________________________________________________________________
Show HN: Shed Light on Your Go Binary Bloat with Go Size Analyzer
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. .
Author : zxilly
Score : 51 points
Date : 2024-08-28 15:15 UTC (7 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| koito17 wrote:
| First, great tool! The README makes me want to try it
| immediately.
|
| I 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).
| zxilly wrote:
| Even if the debugging information is stripped out, this tool
| can still extract a lot of information. This is because Go
| keeps a lot of specific information about functions in its
| pclntab table inside the binary for reflection, GC or other
| work. The tool is able to analyse this part of the information.
| Also, it includes a rudimentary decompiler for extracting
| possible static data calls from the binary, which is simple,
| but seems to work well.
| neonsunset wrote:
| Thanks! This looks really nice and handy. I wish it could work
| with any native binary but I understand that it focuses on Go
| specifically.
|
| 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
___________________________________________________________________
(page generated 2024-08-28 23:01 UTC)