~/talk

Cost of Abstractions in Embedded Systems

Talkat C++ on Sea 2025 · 2025-06-23..06-25· [embedded-and-hardware, c-and-cpp]
links:none on file
slides:none on file

Detailed case studies target an STM32 microcontroller, cross-compiled with GCC -Os and RTTI disabled, measuring binary size and loop iterations on hardware. Replacing C HAL patterns with templates and concepts and using consteval immediate functions moves bitmask and validation work to compile time, enabling compiler devirtualization and inlining. Results show about 2 KB saved (~20%) and ~20% faster loop throughput (4→5 iterations), and the talk pinpoints when static polymorphism or templated addresses beat static objects.

AI-written summary · about

  1. 0:00Cost of abstractions
  2. 2:39Measuring abstraction costs
  3. 7:00Abstraction opportunities in hardware
  4. 10:33Encapsulation cost in registers
  5. 15:52Static functions and binary size
  6. 18:45Templated classes for overhead
  7. 19:50Inheritance without penalties
  8. 21:37Polymorphism overhead
  9. 27:43Dynamic polymorphism analysis
  10. 30:28Static polymorphism with concepts
  11. 34:01Firmware architecture performance
  12. 38:17Hardware abstraction inefficiencies
  13. 41:26Compile-time optimizations
  14. 44:38C++ compile-time validation
  15. 47:53Compile-time branching and bloat
  16. 50:42Benchmarking optimized vs original
  17. 52:06Key takeaways and C++ future
~/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.