Skip to content

Optimize generic pooled SML indexed dispatch and benchmark#4

Merged
gabewillen merged 2 commits into
mainfrom
sml-generic-dispatch
Feb 23, 2026
Merged

Optimize generic pooled SML indexed dispatch and benchmark#4
gabewillen merged 2 commits into
mainfrom
sml-generic-dispatch

Conversation

@gabewillen

Copy link
Copy Markdown

Summary

  • rewrites benchmark/connection/tensor_cache_locality.cpp as a generic SML dispatch benchmark (no link/unlink-specific logic)
  • compares direct flat dispatch, per-actor SML dispatch, pooled indexed SML dispatch, and pooled indexed batch dispatch
  • optimizes sm_pool::process_indexed_batch to reuse a single indexed-event wrapper in the hot loop
  • removes an extra wrapper call in sm_pool::process_event_batch

Validation

  • ran scripts/quality_gates.sh
  • result: All quality gates passed (format, clang-tidy, regression matrix, sanitizer matrix, coverage gate, benchmark smoke build)

Copilot AI review requested due to automatic review settings February 23, 2026 07:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors an existing cache-locality benchmark into a generic “10k actor” dispatch benchmark to compare several dispatch strategies, and applies small hot-loop optimizations to sml::utility::sm_pool batch processing to reduce wrapper overhead.

Changes:

  • Refactors benchmark/connection/tensor_cache_locality.cpp into a generic dispatch-overhead benchmark (direct, per-actor SML, pooled indexed SML, pooled indexed batch).
  • Optimizes sm_pool::process_indexed_batch by reusing an indexed_event wrapper inside the loop.
  • Avoids an extra wrapper function call in sm_pool::process_event_batch.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
include/boost/sml/utility/sm_pool.hpp Reduces per-iteration overhead in indexed/batch dispatch by reusing wrapper objects and calling sm_.process_event directly in batch loops.
benchmark/connection/tensor_cache_locality.cpp Replaces tensor/link-unlink-specific benchmark with a generic dispatch benchmark comparing multiple dispatch approaches.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/boost/sml/utility/sm_pool.hpp Outdated
Comment thread benchmark/connection/tensor_cache_locality.cpp Outdated
@gabewillen gabewillen merged commit 119ca42 into main Feb 23, 2026
10 checks passed
@gabewillen gabewillen deleted the sml-generic-dispatch branch February 23, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants