skillfed

binsize

Tool to analyze the size of a binary from .elf file

binsize v0.1.4 138.1K downloads/30d#11,344 on PyPI1
Permissive license MIT DORMANT released

What it is and what it does

Binsize is a command-line tool that parses compiled ELF binaries and optional map files to report which symbols are consuming the most space. It wraps external analysis tools (bloaty and nm) and provides a CLI interface with subcommands for inspecting, comparing, and visualizing symbol sizes in a hierarchical tree view. The tool stores its configuration—including the project root directory—in a platform-specific settings file managed by platformdirs.

You interact with it primarily through shell commands like `binsize get`, `binsize compare`, and `binsize tree`, each with their own options. It can output results to the terminal or to a file, and allows you to set the project root directory via environment variable, CLI flag, or a Python function call if you're embedding it in a script.

Use it for:

  • Identify which symbols are bloating a firmware binary and prioritize optimization efforts.
  • Compare symbol sizes across two binary builds to detect regressions or improvements.
  • Visualize the hierarchical breakdown of code and data sizes in a compiled ELF file.
  • Automate binary size analysis in a build pipeline by setting root directory via environment variable.
  • Debug unexpected size growth in a compiled artifact by drilling into symbol-level details.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Analyzes symbol sizes in compiled binaries by parsing ELF files and optional map files, helping developers identify which symbols consume the most space.

Yes, if you regularly analyze compiled binaries and need a lightweight CLI tool for symbol-level size profiling. The low install friction and permissive license make it a low-risk addition. However, be aware that maintenance is dormant and you will need to have `bloaty` and `nm` already available on your system—verify that dependency before committing to it.

Install

binsize on PyPI

pip

pip install binsize

uv

uv add binsize

poetry

poetry add binsize

Installing binsize

Before you install

Low install friction with four lightweight runtime dependencies. Maintenance is dormant—last commit was 2023-07-27, though the package was updated on PyPI as recently as 2025-01-27. No active development signal, but no known issues either.

License in practice

MIT license is permissive and imposes no restrictions on use, modification, or distribution in your own projects.

Quickstart

pip install binsize
binsize get firmware.elf -d
binsize compare firmware.elf other_firmware.elf
binsize tree firmware.elf

Requires external tools `bloaty` and `nm` to be installed on the system; also requires setting a project root directory via BINSIZE_ROOT_DIR environment variable, settings.json, or CLI argument.

Verify before relying

  • Whether `bloaty` and `nm` are typically pre-installed on target systems or require separate setup steps.
  • Performance and accuracy of symbol size analysis on large or complex binaries.
  • Whether the dormant maintenance status indicates the tool is stable or at risk of bit-rot with future toolchain changes.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 4 — click, typing-extensions, termcolor, platformdirs
Maintenance dormant — 564 days since the last release
Last repo commit
First released
Downloads 138,108/month — #11,344 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: binsize-0.1.4-py3-none-any.whl

Keywords: binary size, code size, .elf file

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

binary size analysiself file symbol sizecode size profilingbinary bloat detectionfirmware size breakdownsymbol size analyzerelf binary profiler
binary-analysisembedded-developmentsize-optimization

More Build Tools packages