Reducing Binary sizes in Embedded Systems using C++ Exceptions
Khalil Estell
In this talk, I will explore the space cost of exceptions on a Cortex M4 microcontroller using the ARM GNU Toolchain, how to reduce the space cost, compare it to result types and identifying the point where result types become more costly in terms of code size than exceptions. I will delve into the performance of exceptions on the same Cortex M4 microcontroller, demonstrating how I managed to cut the cycle count in half. I'll offer suggestions for improving exception performance on the sad path and explain how exceptions enhance performance on the happy path. Finally, I'll share why, after 11 years in embedded systems, 7 years teaching embedded systems, and 6 years in professional consumer electronics, I now believe that exceptions are the superior error handling mechanism for embedded systems.
Khalil Estell
My passion lies in embedded systems, specifically in making embedded software more portable and user-friendly in C++. I believe that C++ is the ideal language for building the embedded applications I envision, offering the control and capability necessary to handle virtually all tasks in this domain. Currently, my focus is on demonstrating that exceptions are the most effective mechanism for error handling in C++ across all applications, particularly in embedded systems.