Show HN: Shed Light on Your Go Binary Bloat with Go Size Analyzer
The go-size-analyzer is a GitHub tool for analyzing compiled Go binaries, offering detailed size breakdowns, multiple output formats, and both web and terminal interfaces. It encourages contributions and is AGPL-3.0 licensed.
Read original articleThe go-size-analyzer is a GitHub repository tool designed for analyzing the size of compiled Go binaries. It supports various binary formats, including ELF, Mach-O, and PE, and provides a detailed breakdown of size contributions from different packages and sections. Users can output results in multiple formats such as text, JSON, HTML, and SVG. The tool features both a web interface and a terminal UI for interactive exploration of binary sizes, as well as a binary comparison function to identify size differences between two binaries. Installation options include downloading the latest binary from the releases page, using Homebrew for MacOS/Linux, Scoop for Windows, or installing via Go. Usage examples demonstrate different modes, including web mode for browser viewing, terminal UI, text mode, diff mode for comparing binaries, and SVG mode for graphical output. The tool can analyze stripped binaries, although this may affect accuracy. Contributions to the project are encouraged, and a development guide is available. The project is licensed under AGPL-3.0.
- The tool analyzes the size of compiled Go binaries across multiple formats.
- It offers detailed size breakdowns and supports various output formats.
- Users can interact with the tool through a web interface or terminal UI.
- Installation is straightforward with multiple options available.
- Contributions to the project are welcomed, and it is licensed under AGPL-3.0.
Related
How much of your binary executable is just ASCII text?
Daniel Lemire's blog analyzes ASCII text in binary executables of JavaScript runtimes using a Python script. Findings show significant ASCII content, with Node 22 containing one-third ASCII text.
Building static binaries with Go on Linux
The article explains how to build static binaries with Go on Linux, noting that while possible, it requires specific configurations and tools, especially when using C code via cgo.
A simply utility script which allows you to analyze your Python file
The Python File Analyzer is a utility for analyzing Python files, providing insights into functions, classes, imports, and variables. It is easy to use and encourages contributions.
Go Algorithms and Data Structures: Best Practices for Beginners
The GitHub repository features a variety of algorithms implemented in Go, covering domains like data structures, sorting, and cryptography. It is open-source, encourages contributions, and serves educational purposes.
Show HN: Fast Incremental Plaintext Searcher
MightyGrep is a cross-platform search tool for Windows, macOS, and Linux, priced at $9.99, featuring incremental search, multiple exports, and a built-in viewer, with a 5.0 user rating.
(for the container image size analysis I used dive, available here https://github.com/wagoodman/dive)
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).
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
Related
How much of your binary executable is just ASCII text?
Daniel Lemire's blog analyzes ASCII text in binary executables of JavaScript runtimes using a Python script. Findings show significant ASCII content, with Node 22 containing one-third ASCII text.
Building static binaries with Go on Linux
The article explains how to build static binaries with Go on Linux, noting that while possible, it requires specific configurations and tools, especially when using C code via cgo.
A simply utility script which allows you to analyze your Python file
The Python File Analyzer is a utility for analyzing Python files, providing insights into functions, classes, imports, and variables. It is easy to use and encourages contributions.
Go Algorithms and Data Structures: Best Practices for Beginners
The GitHub repository features a variety of algorithms implemented in Go, covering domains like data structures, sorting, and cryptography. It is open-source, encourages contributions, and serves educational purposes.
Show HN: Fast Incremental Plaintext Searcher
MightyGrep is a cross-platform search tool for Windows, macOS, and Linux, priced at $9.99, featuring incremental search, multiple exports, and a built-in viewer, with a 5.0 user rating.