Zero-Cost Abstractions in C++ - High Performance Message Dispatch
summary
Library turns declarative message definitions and Boolean predicates into sum-of-products tables at compile time, then builds indexed lookup structures using a near‑perfect hash and a multiply‑based pseudo pext bit extractor so runtime dispatch avoids virtual calls. Benchmarks show ~2 ns lookups for ~100 keys, ~20 ns for larger maps on x86, and prior embedded runs hit ~145 ns across 1,550 callbacks. Implementation lives in the open source CIB Library and the approach works in practice.
AI-written summary · about
chapters (11)
- 0:00Introduction and speaker background
- 1:50Power management firmware overview
- 8:08CIB library and compile-time initialization
- 15:54Message dispatch case study introduction
- 24:22Message callback design and improvements
- 31:57Message definitions and matchers
- 40:00Boolean expression simplification
- 53:20Lookup algorithm design and optimization
- 1:00:03Parallel bit extract and hash functions
- 1:13:31Benchmarking and performance results
- 1:20:16Q&A session
related talks
01h 00mThere Are No Zero-cost Abstractions
40mBack to Basics: Virtual Dispatch and its Alternatives
01h 16mPolymorphism, Cohesion, and Coupling in C++
01h 31mWhen Abstractions Fix Too Much - Towards Flexible Library Design
57mAbstraction: The True Superpower of C++
01h 00m“When a Microsecond Is an Eternity: High Performance Trading Systems in C++”
01h 13mPractical Production-Proven Constexpr API Elements
01h 18mAbstraction: The True Superpower of C++
