go-size-analyzer
English | 简体中文
A simple tool to analyze the size of a Go compiled binary.
-
Cross-platform support for analyzing
ELF
,Mach-O
, andPE
binary formats - Detailed size breakdown by packages and sections
-
Support multiple output formats:
text
,json
,html
,svg
- Interactive exploration via web interface and terminal UI
-
Binary comparison with diff mode (supports
json
andtext
output)
Installation
MacOS / Linux via Homebrew:
Using Homebrew
brew install go-size-analyzer
Windows:
Using scoop
scoop install go-size-analyzer
Go Install:
go install github.com/Zxilly/go-size-analyzer/cmd/gsa@latest
Usage
Example
Web mode
$ gsa --web golang-compiled-binary
Will start a web server on port 8080, you can view the result in your browser.
Or you can use the WebAssembly version in the browser: GSA Treemap
Note
Due to the limitation of the browser, the WebAssembly version is much slower than the native version Normally costs 10x time to analyze…