C++ Exceptions for Smaller Firmware - Khalil Estell - CppCon 2024

Channel:CppCon · Length:1:24:36 · Published:2024-12-06 · Views:23379

Watch on YouTube

Summary

Khalil Estell's CppCon 2024 talk argues C++ exceptions can reduce binary size in firmware. He digs into how exceptions work and how to shrink their code footprint on embedded platforms.

Why HN recommends it

Pointed to as the in-depth talk on exception mechanics and code size for embedded C++.

In particular, his 2019 presentation [2] describes different error handling techniques — HN, 2025

C, C++, Rust, Go & systems languages · Software performance & optimization · Embedded systems & DIY electronics

Subtitles (excerpt)

so everyone I want to teach you guys about how you can make your binary smaller by using C++ exceptions so a little about me if you've seen the uh the name Cy anywhere around that's probably me I use that name that username for almost everything so a little B about myself graduated from San Jose State in 2017 I'm an ex googler I worked on a couple of products that you might you have heard of uh the Google pixel watch the original I was the directly I was the directly responsible engineer for the haptics and the bootloader and the speaker and the microphone and eventually when I got tired of that I moved over to the Google pixel Buds and worked on code optimization so we could fit more features and um bug fixes into the device I'm also a volunteer at San Jose State University and I primarily help out with the robotics team at San Jose State and I'm also an isoc Plus+ member since like last year before we go any further I want to go over the motivation for why this talk even exists and how I got to this point so about six years ago I was teaching a class called Computer Engineering 146 it's intro to embedded systems in this class I developed a formare framework for my students It Was Written in C++ uh we followed the C++ core

On Hacker News

> I don't have enough time to watch these kinds of presentations. Then let me pick and share some of my favorites that I found enlightening, and summarize with some information that I found useful. By far, the most useful one is Khalil Estell's presentation last year [0]. It's a fairly face paced but relatively deep dive into exception mechanics. At the end, he advocates for a new tool that would… — inetknght, 2025-09
I just thought I'd mention that Khalil Estell is doing some work regarding exceptions in embedded and bare metal programming. In the first of his talks about this topic ( [VIDEO] ) he mentions that a lot of the bloat in exception handling is including printf in order to print out the message when terminating the program. For those interested he has another presentation on this topic [LINK] — daemin, 2026-03
There was an interesting talk about C++ exceptions in smaller firmware at CppCon last year: [VIDEO] Basically, the overhead of exceptions is probably less than handling the same errors manually in any non-trivial program. Also, it's not like these table doesn't exist in other languages. Both Rust and Go have to unwind. — neonz80, 2025-11
A specific presentation I'd point to is Khalil Estell's presentation on reducing exception code size on embedded platforms at [VIDEO] But honestly you'd get vast majority of the benefit just by skimming through the slides at [LINK] With a couple of symbols you define yourself a lot of the associated g++ code size is sharply reduced while still allowing exceptions to work. (Slide 60 on) — mpyne, 2025-09
Khalil Estell has some great work on that. [VIDEO] is one link - very low level technical of what is really happening. He has other talks and papers if you search his name. — bluGill, 2025-02

Related videos