High-Performance Message Dispatch in C++
summary
A compile-time C++ dispatch replaces linear predicate scans with generated lookup indices and set intersections, yielding 100–200 ns latency on a 400 MHz ARC HS4x dev board and never exceeding 145 ns in benchmarks up to 155 callbacks. The system uses the Intel CIB framework, O3 builds, multiple lookup strategies (linear, direct-array, hash, frozen/perfect-hash experiments via hash prospector), represents matches as bitmask intersections, and invokes callbacks directly; code and a pull request live on the Intel CIB GitHub.
AI-written summary · about
chapters (26)
- 0:00Introduction and speaker background
- 1:09What is message dispatch
- 2:34Real-time processing challenges
- 3:37Firmware composability principles
- 5:51CIB Library overview
- 7:13Message definition and callbacks
- 8:58Components and composition
- 10:01Independent performance goals
- 11:25Benchmarking old vs new algorithms
- 13:11Database-inspired lookup indices
- 14:17Example motor control system
- 16:23Lookup algorithm strategies
- 19:14Linear search performance
- 20:40Direct array lookup benefits
- 21:20Hash lookup efficiency
- 22:48Composite lookup strategy
- 24:59Set intersection with bitmasks
- 26:04Executing matching callbacks
- 27:08Declarative interface benefits
- 28:13Open source and future work
- 29:17Q&A: Callback priorities
- 31:41Q&A: Cache impact and use cases
- 34:30Q&A: Compile time impact
- 36:39Q&A: Perfect hash functions
- 38:45Q&A: Optimizing lookup columns
- 40:37Closing remarks and thanks
related talks
35mAlgorithmic and microarchitecture optimizations of C++ applications
49mAlgorithmic and microarchitecture optimizations of C++ applications
40mBack to Basics: Virtual Dispatch and its Alternatives
01h 16mPolymorphism, Cohesion, and Coupling in C++
57mAdventures in SIMD-Thinking (part 1 of 2)
05mMaximising Throughput & Minimising Latency in High-Performance C++ Code
01h 30mTuning C++: Benchmarks, and CPUs, and Compilers! Oh My!
49mAn Engineering Approach to Optimising C++
