A webpack plugin and CLI that renders bundle contents as an interactive zoomable treemap to show which modules take up the most size.
Zxilly/go-size-analyzer
A command-line tool that breaks down the size of compiled Go binaries by package, section and symbol, with text, JSON, HTML, SVG, web and terminal UI output.
- Stars
- 2,195
- Forks
- 45
- Open issues
- 9
- Last commit
- 3 days ago
What is it?
go-size-analyzer answers the question of what makes a compiled Go binary large. It parses ELF, Mach-O, PE and experimental WebAssembly binaries and attributes their size to packages (including the standard library and vendored dependencies) and to binary sections such as .rodata, .gopclntab and DWARF debug data.
Results can be printed as a text table, exported as JSON, HTML, or SVG treemap, or explored interactively through a local web interface or a terminal UI. A diff mode compares two binaries or two saved JSON results, showing per-package and per-section growth, which is useful for tracking size changes between Go versions or builds.
The tool can also be run in the browser via a WebAssembly build, though it is noticeably slower there and is recommended only for smaller binaries. Analysis of stripped binaries works but may be less accurate.
Key features
- 01Analyzes ELF, Mach-O, PE and experimental WebAssembly binaries.
- 02Breaks down size by package, standard library, vendor dependency and section.
- 03Outputs text, JSON, HTML and SVG treemap reports.
- 04Provides an interactive web interface and a terminal UI.
- 05Compares two binaries or saved JSON results in diff mode.
Use cases
- Finding which dependencies inflate a Go service or CLI binary.
- Tracking binary size changes between Go toolchain versions or commits.
- Sharing an interactive size treemap of a build with teammates over a network.
- Checking whether debug sections or symbols are a major part of a release binary.
Quick start
- 1
Install with Go
go install github.com/Zxilly/go-size-analyzer/cmd/gsa@latest - 2
Start the web interface on a compiled Go binary
gsa --web golang-compiled-binary
Things to know
- Licensed under AGPL-3.0, a copyleft license that requires sharing modified source code when served over a network.
- Building from source requires Go 1.27 or later.
- Analysis of stripped binaries may be inaccurate.
- The WebAssembly version in the browser is much slower than the native version.
In collections
Topics
FAQ
- What is go-size-analyzer?
- A command-line tool that breaks down the size of compiled Go binaries by package, section and symbol, with text, JSON, HTML, SVG, web and terminal UI output. go-size-analyzer answers the question of what makes a compiled Go binary large. It parses ELF, Mach-O, PE and experimental WebAssembly binaries and attributes their size to packages (including the standard library and vendored dependencies) and to binary sections such as .rodata, .gopclntab and DWARF debug data.
- Is go-size-analyzer free to use? What license does it have?
- go-size-analyzer is open source under the AGPL-3.0 license. Check the license terms before using it in commercial products.
- Is go-size-analyzer still maintained?
- Actively maintained. The last commit to go-size-analyzer was on Nov 4, 2026.
- What can I use go-size-analyzer for?
- Finding which dependencies inflate a Go service or CLI binary. Tracking binary size changes between Go toolchain versions or commits. Sharing an interactive size treemap of a build with teammates over a network. Checking whether debug sections or symbols are a major part of a release binary.
- How do I install go-size-analyzer?
- Install with Go: go install github.com/Zxilly/go-size-analyzer/cmd/gsa@latest Start the web interface on a compiled Go binary: gsa --web golang-compiled-binary
- Where can I get go-size-analyzer?
- The source code and installation instructions are on GitHub: https://github.com/Zxilly/go-size-analyzer
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A cross-platform hex editor for reverse engineering and binary analysis, with a pattern language for parsing file structures.
A jq-like command-line tool and query language for inspecting and querying binary file formats, with decoders for dozens of formats.
Interactive terminal disk space analyzer that scans directories, finds what is using space, and deletes it from the TUI.
Open-source macOS CLI (mo) for deep cleaning, app uninstalling, disk analysis, maintenance and live system status, with a separate native Mac app.
A CLI tool that builds standalone, dependency-free PHP binaries with chosen extensions for Linux, macOS and Windows.