whatisgithub

What is codesizer?

wren6991/codesizer — explained in plain English

Analysis updated 2026-05-18

48PythonAudience · developerComplexity · 2/5Setup · moderate

In one sentence

A Python tool that analyzes compiled firmware files and shows what functions take up the most space, even when the compiler has merged small functions together. It outputs an interactive HTML report.

Mindmap

mindmap
  root((repo))
    What it does
      Analyzes compiled binaries
      Finds inlined function code
      Generates HTML tree report
    Tech stack
      Python
      objdump
      addr2line
    Use cases
      Optimize firmware size
      Audit code space usage
      Explore sample RP2350 report
    Inputs
      ELF firmware file
      Compiler tool prefix
      Output HTML filename
    Audience
      Embedded firmware developers
      Resource-constrained device makers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Analyze a compiled firmware ELF file to find which functions take up the most space.

USE CASE 2

Explore a sample report from the Raspberry Pi RP2350 bootrom included in the repo.

USE CASE 3

Generate an interactive HTML tree showing inlined code size breakdowns for your project.

What is it built with?

Pythonobjdumpaddr2line

How does it compare?

wren6991/codesizerdevelp10/rustinterviewquiestionsfukikomarga/exodus-fake-balance
Stars484848
LanguagePythonPythonPython
Setup difficultymoderatemoderatemoderate
Complexity2/52/52/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires compiler toolchain binaries like objdump and addr2line for your target hardware, plus an ELF file to analyze.

The explanation does not mention a license, so the usage terms for this repository are unknown.

So what is it?

CodeSizer is a Python tool that helps developers figure out why a compiled program file is unusually large. It focuses on a specific niche: embedded firmware, where software runs on small, resource-constrained devices. In this context, every byte matters, so understanding what takes up space in the final compiled binary is important. The problem CodeSizer solves comes from how modern compilers optimize code. Compilers frequently inline small functions, meaning they paste the body of one function directly into another to avoid the overhead of a function call. After this optimization, a single function in the compiled file may actually contain the code of dozens of other functions that were folded into it. Standard profiling tools attribute the size to the outer function, hiding the true source of the bulk. CodeSizer uses two existing tools, objdump and addr2line, to trace back through these inline expansions at every instruction address. This lets it correctly assign code size to the right place in the call tree. The result of running CodeSizer is a static HTML report file. The report presents the size data as a tree view, so you can see which functions and their inlined sub-calls consume the most space. A small bit of JavaScript in the report lets you expand and collapse sections of the tree to explore the data in your web browser. To use the tool, you run it from a terminal and provide an input ELF file, which is a common format for compiled firmware, and a name for the output HTML file. You also need to tell it where to find the matching compiler tools for your specific hardware, using a prefix flag. For example, you can point it at tools for ARM or RISC-V processors depending on your project. The repository includes a sample report generated from the Raspberry Pi RP2350 bootrom, so you can view a real example before trying it on your own files.

Copy-paste prompts

Prompt 1
I have a compiled ELF firmware file and want to understand why it's so large. How do I use CodeSizer to generate an HTML report showing which functions and inlined code take up the most space?
Prompt 2
Help me install and run CodeSizer on my ARM firmware project. What prefix flag do I need to pass so it finds my ARM compiler tools like objdump and addr2line?
Prompt 3
Show me how to read the CodeSizer HTML tree report. How do I expand and collapse sections to find which inlined functions are bloating my compiled binary?
Prompt 4
I'm building firmware for a small embedded device and need to reduce the binary size. How can CodeSizer help me find functions that were inlined by the compiler and are hidden inside other functions?

Frequently asked questions

What is codesizer?

A Python tool that analyzes compiled firmware files and shows what functions take up the most space, even when the compiler has merged small functions together. It outputs an interactive HTML report.

What language is codesizer written in?

Mainly Python. The stack also includes Python, objdump, addr2line.

What license does codesizer use?

The explanation does not mention a license, so the usage terms for this repository are unknown.

How hard is codesizer to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is codesizer for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.