~/talk

Cost of C++ Abstractions in C++ Embedded Systems

Talkat CppCon 2024 · on Friday, 2024-09-20· at 09:00· Cottonwood 2/3, 6700 North Gaylord Rockies Boulevard· [rust]
links:none on file
slides:none on file

Measures on an STM32 breadboard with two ADCs and LEDs show concrete results: a minimal firmware starts at 2 kilobytes base firmware, replacing runtime bitmasking with templates concepts immediate functions and constexpr if moves work to compile time, restores binary size to the C baseline for many cases and yields ~20% runtime savings (reported as up to ~30% in the demo). The project compiles, flashes, and benchmarks actual iterations, demonstrates static polymorphism via concepts vs. virtual calls, and pinpoints when templated code bloats binaries.

AI-written summary · about

  1. 0:00C++ in embedded systems
  2. 1:30Motivation for C++ abstractions
  3. 2:55Hardware abstraction layer analysis
  4. 3:38Research methodology
  5. 5:02Firmware binary size
  6. 6:27Current HAL implementation
  7. 7:35Abstraction layers with encapsulation
  8. 10:51Register overhead of encapsulation
  9. 13:20Static member functions impact
  10. 15:28Templated static member functions
  11. 17:15Inheritance in hardware abstraction layers
  12. 18:37Polymorphism for hardware interfaces
  13. 20:44Dynamic polymorphism overhead
  14. 24:32Virtual function call overhead
  15. 26:38Static polymorphism with concepts
  16. 30:31Firmware architecture performance
  17. 34:51Inefficiencies in traditional hardware abstraction layers
  18. 36:16Compile-time nature of embedded
  19. 38:04Optimizing HAL with C++
  20. 40:53C++ type system tools
  21. 43:38Compile-time optimizations
  22. 44:43Optimized firmware results
  23. 45:49Code bloat trade-offs
  24. 46:31Key conclusions on abstractions
  25. 47:56Future of C++ in embedded
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.