C++ Exceptions Reduce Firmware Code Size - Khalil Estell - ACCU 2024

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • ACCU Membership: tinyurl.com/yd...
    ---
    C++ Exceptions Reduce Firmware Code Size - Khalil Estell - ACCU 2024
    ---
    Universally, exceptions are avoided in embedded systems C++ code, with a preference for error codes as out parameters, return values, or sum types like std::expected<T,E>. This avoidance stems from two main issues: the size of the exception handling runtime and the performance cost of throwing an exception versus returning a status code. But what if I were to tell you that exceptions are the better choice for producing smaller binaries than using the alternatives?
    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.
    Slides: accu.org/conf-...
    Sponsored By think-cell
    ---
    Khalil Estell
    I am an African American who graduated with a degree in Computer Engineering from San Jose State University (SJSU) in 2017. Since March 2018, I have been working at Google, where I was a key firmware developer for the Google Pixel Watch, Google Pixel Buds Pro, and a few other projects that were ultimately not released. In addition to my work at Google, I served as a volunteer instructor at SJSU from 2017 to 2020 and have sponsored and mentored the SJSU Robotics team since 2017.
    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.
    ---
    The ACCU Conference is the annual conference of the ACCU membership, but is open to any and all who wish to attend. The tagline for the ACCU is 'Professionalism in Programming', which captures the whole spectrum of programming languages, tools, techniques and processes involved in advancing our craft. While there remains a core of C and C++ - with many members participating in respective ISO standards bodies - the conference, like the organisation, embraces other language ecosystems and you should expect to see sessions on C#, D, F#, Go, Javascript, Haskell, Java, Kotlin, Lisp, Python, Ruby, Rust, Swift and more.The ACCU Conference is a conference by programmers for programmers about programming.
    Discounted rates for members.
    ACCU Membership: tinyurl.com/yd...
    2024 Program: accu.org/conf-...
    accu.org
    www.accuconfer...
    mastodon.socia...
    / accu-conference
    bsky.app/profi...
    / accuorg
    / accuconf
    ---
    RUclips Videos Filmed, Edited & Optimised by Digital Medium: events.digital...
    #accuconf #firmware #exceptionhandling #programming #cplusplus

Комментарии • 27