Skip to content

v0.2.0: Zero-overhead dispatch

Choose a tag to compare

@DeguiLiu DeguiLiu released this 14 Feb 16:02
· 16 commits to master since this release

What's New

Zero-overhead dispatch path

  • ProcessBatchWith<Visitor>: Compile-time dispatch bypassing callback_table_ and shared_mutex entirely. 19-42% faster than ProcessBatch.
  • StaticComponent<Derived, PayloadVariant>: CRTP zero-overhead component with HasHandler SFINAE trait detection. No virtual destructor, no shared_ptr, handler calls are inlineable.
  • FixedFunction<Sig, Capacity>: SBO type-erased callable replacing std::function. Zero heap allocation, static_assert on overflow.

Breaking changes

  • CallbackType changed from std::function<void(const EnvelopeType&)> to FixedFunction<void(const EnvelopeType&), 64>. Lambda captures must fit within 64 bytes.

Performance (MPSC default, x86-64)

Path Latency vs v0.1.0
ProcessBatchWith (Visitor) 129 ns/msg New
ProcessBatch (Callback) 160 ns/msg -
FULL_FEATURED enqueue 38 ns/msg improved
BARE_METAL enqueue 30 ns/msg improved
E2E Latency P99 525 ns improved

Tests

  • 171 test cases (was 70), all passing
  • New test files: test_fixed_function, test_visitor_dispatch, test_static_component

Files

  • 3 header files: mccc.hpp + component.hpp + static_component.hpp
  • Header-only, zero external dependencies, pure C++17