Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.6%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
🔍 Go binary size SVG treemap
Basic Info
Statistics
- Stars: 451
- Watchers: 7
- Forks: 15
- Open Issues: 4
- Releases: 5
Topics
Metadata Files
README.md
🔍 Go binary size SVG treemap
Make treemap breakdown of Go executable binary
$ go install github.com/nikolaydubina/go-binsize-treemap@latest
$ go tool nm -size <binary finename> | go-binsize-treemap > binsize.svg
Disclaimer
Should you be worried about executable binary size?
In 2022, few seconds of cat videos or even a single image is tens of MBs.
Transferring them over network is not a big deal either.
So, probably, you should not worry too much about it.
However, this tool can still be useful in couple of cases.
- You are studying compiler.
- You are investigating what 3rd party dependencies are getting included in binary.
- You are checking much data is getting embedded.
- You are estimating how much code is getting included by packages.
- You are researching which symbols included.
- You are doing cgo.
- You are doing treemap visualizations.
I build this in my spare time as another usecase for Go treemap tooling that I built before. Enjoy! Submit issues or PRs!
Examples
github.com/gohugoio/hugo 62MB, this famous example of large Go project
github.com/cockroachdb/cockroach 71MB, this famous db is building with C++
github.com/goccy/go-graphviz 6.5MB, this project has CGO and builds with lots of graphviz code in C
github.com/zalando/skipper 36MB, is a large Go project, some builds can include C
Knowledge Base
What is
go.itab?
This is interface related code. Refer to this article by Russ Cox.
What is
runtime.pclntab? And why it is so big?
As investigated Cockroach team, it is Go runtime structure for traces (reference). Past discussions in GitHub thread on why it is big and what to do about it (well, nothing).
Known Issues and TODOs
- [ ] Size slightly mismatches actual binary size. Including unknown does not help.
- [ ] Better symbol names parsing for C++
- [ ] identify go:embed
- [ ] color by type + increasing luminance (sys; user; c++; go:embed; etc.)
- [ ] color by symbol type
- [ ] heat by ????
Related Work
- https://github.com/knz/go-binsize-viz — this was an inspiration for current tool. However, instead of Python and D3 and Javascript, this tool is using single stack purely in Go and has test coverage. Arguably, the downside it is not interactive.
- https://github.com/jondot/goweight — looks like it was working in the beginning, but as of 2022-01-22 it does not work anymore for me and there were reports dating back to 2020-01-23 for it to be not accurate.
Reference
- https://github.com/knz/go-binsize-viz
- https://github.com/jondot/goweight
- https://github.com/nikolaydubina/treemap
- https://github.com/nikolaydubina/go-cover-treemap
- https://github.com/golang/go/blob/master/src/cmd/nm/doc.go
- https://linux.die.net/man/1/c++filt
- https://github.com/goccy/go-graphviz
- https://research.swtch.com/interfaces
Appendix A: Strange Output / C++ / CGO
You many need to demungle symtab file first. Install c++flit. Then process symtab first.
Note, c++ support is work in progress.
$ go tool nm -size <binary finename> | c++filt | go-binsize-treemap > binsize.svg
Appendix B: Large dimensions and lots of details
If you set dimensions very large you can see lots of details and navigate map.
4096x4096 is recommended
... but you can go much higher
Appendix C: Small dimensions and informative preview
You can generate small preview of project that fits for embedding in README for example.
1024x256 is recommended
Docs
bash
$ cat testdata/go-graphviz.symtab | ./go-binsize-treemap -csv > docs/go-graphviz.csv
$ cat testdata/go-graphviz.symtab | ./go-binsize-treemap > docs/go-graphviz.svg
$ cat testdata/go-graphviz.symtab | ./go-binsize-treemap -w 4096 -h 4096 > docs/go-graphviz-4096x4096.svg
$ cat testdata/cockroach.symtab | ./go-binsize-treemap -csv > docs/cockroach.csv
$ cat testdata/cockroach.symtab | ./go-binsize-treemap > docs/cockroach.svg
$ cat testdata/cockroach.symtab | ./go-binsize-treemap -w 4096 -h 4096 > docs/cockroach-4096x4096.svg
$ cat testdata/skipper.symtab | ./go-binsize-treemap > docs/skipper.svg
$ cat testdata/hugo.symtab | ./go-binsize-treemap -csv > docs/hugo.csv
$ cat testdata/hugo.symtab | ./go-binsize-treemap > docs/hugo.svg
$ cat testdata/hugo.symtab | ./go-binsize-treemap -w 1024 -h 128 > docs/hugo-1024x128.svg
$ cat testdata/hugo.symtab | ./go-binsize-treemap -w 1024 -h 256 > docs/hugo-1024x256.svg
$ cat testdata/hugo.symtab | ./go-binsize-treemap -w 1024 -h 512 > docs/hugo-1024x512.svg
$ cat testdata/hugo.symtab | ./go-binsize-treemap -w 4096 -h 4096 > docs/hugo-4096x4096.svg
$ cat testdata/hugo.symtab | ./go-binsize-treemap -w 16384 -h 16384 > docs/hugo-16384x16384.svg
Owner
- Name: Nikolay Dubina
- Login: nikolaydubina
- Kind: user
- Repositories: 92
- Profile: https://github.com/nikolaydubina
Citation (CITATION.cff)
cff-version: 1.2.0 message: If you reference this tool in publication, please cite it as below. title: Go Binsize Treemap abstract: Treemap of Go binary based on authors: - family-names: Dubina given-names: Nikolay version: 2.1 date-released: 2022-03-28 license: MIT repository-code: https://github.com/nikolaydubina/go-binsize-treemap url: https://github.com/nikolaydubina/go-binsize-treemap
GitHub Events
Total
- Watch event: 81
- Issue comment event: 2
Last Year
- Watch event: 81
- Issue comment event: 2
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Nikolay Dubina | n****b@g****m | 44 |
| dependabot[bot] | 4****] | 2 |
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 5
- Total pull requests: 4
- Average time to close issues: about 1 month
- Average time to close pull requests: about 3 hours
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 2.0
- Average comments per pull request: 1.0
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 2
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- nikolaydubina (4)
- mrbardia72 (1)
Pull Request Authors
- dependabot[bot] (4)
- nikolaydubina (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
- Total downloads: unknown
-
Total dependent packages: 1
(may contain duplicates) -
Total dependent repositories: 0
(may contain duplicates) - Total versions: 10
proxy.golang.org: github.com/nikolaydubina/go-binsize-treemap
- Homepage: https://github.com/nikolaydubina/go-binsize-treemap
- Documentation: https://pkg.go.dev/github.com/nikolaydubina/go-binsize-treemap#section-documentation
- License: MIT
-
Latest release: v0.2.3
published almost 2 years ago
Rankings
proxy.golang.org: github.com/Nikolaydubina/go-binsize-treemap
- Documentation: https://pkg.go.dev/github.com/Nikolaydubina/go-binsize-treemap#section-documentation
- License: mit
-
Latest release: v0.2.3
published almost 2 years ago
Rankings
Dependencies
- github.com/lucasb-eyer/go-colorful v1.2.0
- github.com/nikolaydubina/treemap v1.2.0
- github.com/lucasb-eyer/go-colorful v1.2.0
- github.com/nikolaydubina/treemap v1.1.0
- github.com/nikolaydubina/treemap v1.2.0
- actions/checkout v3.1.0 composite
- actions/upload-artifact v3.1.0 composite
- github/codeql-action/upload-sarif v2.2.4 composite
- ossf/scorecard-action v2.3.1 composite
- actions/checkout v2 composite
- actions/setup-go v2 composite
- codecov/codecov-action v1.0.10 composite