How to make smaller C and C++ binaries

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. ml-compiler-opt

    Infrastructure for Machine Learning Guided Optimization (MLGO) in LLVM.

    If you're using Clang/LLVM you can also enable ML inlining[1] (assuming you build from source) which can save up to around 7% if all goes well.

    There are also talks of work on just brute forcing the inlining for size problem for embedded releases for smallish applications. It's definitely feasible if the problem is important enough to you to throw some compute at it [2].

    1. https://github.com/google/ml-compiler-opt

    2. https://doi.org/10.1145/3503222.3507744

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. bloaty

    Bloaty: a size profiler for binaries

    I’ve gotten good insight into what takes up space in binaries by profiling with Bloaty (https://github.com/google/bloaty). My last profiling session showed that clang’s ThinLTO was inlining too aggressively in some cases, causing functions that should be tiny to be 75 kB+.

  4. connectedhomeip

    Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.

    Bloaty is a nice tool.

    When I worked on Matter a couple years ago, we had the problem that its backend http://www.capstone-engine.org/ did not support Xtensa, and produced some Python tools that could take output from bloaty or similar data from readelf or elftools, and produce several kinds of report.

    https://github.com/project-chip/connectedhomeip/blob/master/...

  5. capstone

    Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.

    Bloaty is a nice tool.

    When I worked on Matter a couple years ago, we had the problem that its backend http://www.capstone-engine.org/ did not support Xtensa, and produced some Python tools that could take output from bloaty or similar data from readelf or elftools, and produce several kinds of report.

    https://github.com/project-chip/connectedhomeip/blob/master/...

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • A Developer’s Guide to Matter Protocol: Building Smart Home Applications With Matter SDK

    2 projects | dev.to | 14 Mar 2025
  • How do you move you into more technical/R&D positions?

    1 project | /r/ExperiencedDevs | 4 Jun 2023
  • ModuleNotFoundError: No module named 'matter_idl'

    3 projects | /r/esp32 | 14 May 2023
  • Matter Raspberry Pi GPIO Commander – Turn Your Pi into a Matter Lighting Device

    2 projects | news.ycombinator.com | 13 May 2023
  • Any open source repositories/projects written in C++?

    3 projects | /r/embedded | 10 May 2023

Did you know that C++ is
the 7th most popular programming language
based on number of references?