perf: add MessagePipe attribution benchmarks - #419
Merged
Eli Pinkerton (wallstop) merged 1 commit intoAug 15, 2026
Conversation
Contributor
Performance NumbersMeasured commit: Benchmark or harness paths changed, so historical deltas are non-comparable:
Historical Standalone deltaDelta direction: + is better; - is worse. Historical delta omitted because benchmark or harness code changed in this pull request. Current TargetMap evidenceThese raw rows are current-run diagnostics. Use fresh bracketed controls before accepting a micro-optimization. |
8 tasks
Eli Pinkerton (wallstop)
deleted the
session-215-messagepipe-attribution
branch
August 15, 2026 02:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
disabled-token, and active-token register/remove paths
result extraction, rendering, and stable scenario keys
Why
Issue #414 shows that DxMessaging trails MessagePipe most strongly on fixed-overhead
one-listener dispatch and subscribe/unsubscribe churn, while higher-fan-out and keyed
rows are much closer or faster. The previous dispatch candidate did not clear the
repository's A/B/A claim threshold. These diagnostics isolate the bus, handler, token,
and augmented-callback layers before another production optimization is attempted.
No production runtime path changes in this pull request.
Measurement contract
handler, seven fresh timing states, and the minimum wall-clock sample.
warms 10000 cycles on one state, then measures a second 10000-cycle batch so the
allocation state matches the warmed
SubUnsubcomparison shape.n/abecause its profiler recorder isstripped.
UntargetedFlood_OneDirectHandlerandUntargetedFlood_OneHandlershare the payload,active handler, priority, by-ref fast slot, and fan-out; token ownership and the
augmented callback are the intended variable.
Validation
npm test(421 passed)npm run format:checknpm run lint:markdownnpm run check:spellingnpm run validate:alldotnet tool run csharpier check .node --test scripts/__tests__/unity-perf.test.js(29 passed)git diff --checkRelated: #414
Note
Low Risk
Changes are limited to benchmarks, tests, documentation, and scenario rendering; production messaging paths are untouched.
Overview
Adds diagnostic perf harness only (no production runtime changes) to isolate MessagePipe-related overhead before further optimizations.
Registration attribution introduces four wall-clock rows (
RegistrationAttribution_*_131072) that time complete register/remove cycles through direct bus, direct handler, disabled token, and active token paths, with separate allocation batches aligned to the comparisonSubUnsubshape. A newRegistrationAttributionBenchmarkentry runs onDispatchThroughputBenchmarksat NUnit order 1, between published dispatch (0) and deregistration attribution (2).Dispatch attribution adds
UntargetedFlood_OneDirectHandlerbeside the existing token-augmented one-handler row so token ownership and the augmented callback are the only variables. Contract observations now track token vs direct registration ownership, andBenchmarkRegistrationScopecan register untargeted handlers directly with proper teardown.Tooling & docs:
perf-scenarios.js, unity perf tests, and the perf methodology runbook are updated for 35 dispatch scenarios (including the eight attribution rows), stable keys, and interpretation notes. Contract tests pin exact per-layer state, scenario keys, and benchmark ordering.Reviewed by Cursor Bugbot for commit bf2469c. Bugbot is set up for automated code reviews on this repo. Configure here.