go-size-analyzer
English | 简体中文
A simple tool to analyze the size of a Go compiled binary.
Installation
Download the latest release from the release page
Use go install
is not recommended, because it won't include the embed ui template, which is required for the web mode.
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.
The web page will look like this:
You can click to expand the package to see the details.
Text mode
$ gsa docker-compose-linux-x86_64
+------------------------------------------------------------------------------+
| docker-compose-linux-x86_64 |
+---------+-----------------------------------------------+--------+-----------+
| PERCENT | NAME | SIZE | TYPE |
+---------+-----------------------------------------------+--------+-----------+
| 27.76% | .gopclntab | 17 MB | section |
| 15.17% | .rodata | 9.5 MB | section |
| 11.63% | k8s.io/api | 7.3 MB | vendor |
| 6.69% | .strtab | 4.2 MB | section |
| 3.47%
…