Skip to content

perf(runtime): route local callbacks directly - #21

Closed
ReubenBond wants to merge 10 commits into
rb-investigate-message-target-cachefrom
rb-perf-runtime-route-callbacks-directly
Closed

perf(runtime): route local callbacks directly#21
ReubenBond wants to merge 10 commits into
rb-investigate-message-target-cachefrom
rb-perf-runtime-route-callbacks-directly

Conversation

@ReubenBond

Copy link
Copy Markdown
Owner

Stacked on dotnet#10886.

Local responses currently recover callback ownership through the shared callback table even though the originating request and response remain in the same process.

This change carries the exact callback identity on Message as process-local runtime state. MessageFactory transfers it to success, rejection, and status responses, while message serialization intentionally omits it so forwarded and remote responses use the normal fallback path.

The silo fallback path uses a correlation-ID-only 128-stripe callback table, relying on the singleton MessageFactory host-uniqueness guarantee. Cleanup is identity-checked to prevent stale/ABA removal, shutdown closes admission and drains in-progress publication, scans use pooled snapshots, and exact test-only counts lock all stripes. OutsideRuntimeClient retains its existing ConcurrentDictionary path.

Hosted-client measurements against dotnet#10886 show:

  • ConcurrentPing: 4.54M/s to 5.98M/s (+31.5%)
  • AdaptivePing: 6.71M/s to 7.46M/s (+11.0%)
  • Sequential mean: 5.146 us to 3.771 us (-26.7%)
  • Sequential p95: 6.725 us to 4.368 us (-35.0%)
  • Allocation: 632 B to 568 B per call (-10.1%)

CPU profiles show inclusive response-callback processing samples falling from 689 ms to 204 ms. A SEDA callback-owner pipeline was also evaluated and rejected because its registration hop substantially regressed isolated latency and hot-sender throughput.

@ReubenBond
ReubenBond force-pushed the rb-perf-runtime-route-callbacks-directly branch from 2e8b817 to 88ed247 Compare August 29, 2026 00:32
@ReubenBond

Copy link
Copy Markdown
Owner Author

Superseded by dotnet#10913 after rebasing the branch onto upstream main.

@ReubenBond ReubenBond closed this Aug 29, 2026
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.

1 participant