Performance Benchmarks¶
This page shows the latest dispatch-throughput and cross-library comparison numbers for DxMessaging. The published tables come from a Release Standalone IL2CPP player, the same backend and build shape used by shipped games.
These numbers are for orientation, not a leaderboard. Real-world performance depends on what your handlers actually do; the benchmarks measure raw dispatch cost with minimal handler work. For the full methodology, CI mechanics, baseline capture, the regression smoke gate, and how to add or bump a comparison library, see the Perf Benchmark Methodology runbook.
See also: Performance optimizations for design details.
How to read these tables¶
- Scopes. Each dispatch table is labeled by execution scope and backend. Standalone (IL2CPP) -- a Release player on the ahead-of-time backend shipped games run -- is the only published scope. The renderer also understands PlayMode and EditMode rows for local or manually dispatched runs; backends differ by design, so read each scope against its own backend.
- Throughput. Reported as emits per second. Higher is better. Registration scenarios report wall-clock time instead, where lower is better. The published throughput numbers come from the Standalone (IL2CPP) leg.
- Allocations. Lower is better, and
0means the measured operation did not allocate. Release IL2CPP players cannot expose Unity's allocation recorder, so the published Standalone tables omit allocation columns instead of showing a page ofn/avalues. Editor benchmark runs can include those columns. - Comparison matrix
N/A. The cross-library matrix has a column per scenario and a row per library. A cell showsN/Awhen that library does not idiomatically support that capability -- it is a capability gap, not a failure, and the value is never faked. - Comparison matrix winners. In the throughput matrix the fastest technology per scenario column is rendered in bold (ties are all bolded;
N/Anever wins). The GC-allocations and GC-allocated-bytes matrices are not bolded: an allocation count or byte total is a property to read, not a race.
Latest CI dispatch throughput¶
The block below is regenerated from the latest benchmark run. It includes the Standalone IL2CPP dispatch table, cross-library comparisons, and the hardware summary needed to interpret the results. Do not edit it by hand.
Latest CI benchmark run: Unity 6000.5.2f1, commit e76cdbf7b3b3c87e3b57881cff3b93d5e6d7977a.
Runner: 13th Gen Intel(R) Core(TM) i9-13900KF, 24C/32T @ 3000MHz; 64GB DDR5@4200; NVIDIA GeForce RTX 3060; Microsoft Windows 11 Pro N (10.0.26200)
Dispatch throughput - Standalone (IL2CPP)¶
Platform: Standalone IL2CPP x64 Release (WindowsPlayer; Unity 6000.5.2f1).
| Scenario | Throughput / Wall clock |
|---|---|
| Empty Bus Dispatch | 48.08 M emits/sec |
| Untargeted Flood (One Handler) | 28.70 M emits/sec |
| Untargeted Flood (One Direct Handler) | 32.20 M emits/sec |
| Untargeted Flood (Two Handlers, One Priority) | 26.01 M emits/sec |
| Untargeted Flood (Three Handlers, One Priority) | 28.00 M emits/sec |
| Untargeted Flood (Four Handlers, One Priority) | 24.37 M emits/sec |
| Untargeted Flood (Four Handlers, Four Priorities) | 26.03 M emits/sec |
| Untargeted Flood (Sixteen Handlers, One Priority) | 14.41 M emits/sec |
| Untargeted Flood (One Inactive Handler) | 30.46 M emits/sec |
| Untargeted First Dispatch (Cold, Distinct Types) | 0.284 ms |
| Targeted Flood (No Matching Target) | 12.72 M emits/sec |
| Targeted Flood (One Listener) | 9.91 M emits/sec |
| Targeted Flood (Sixteen Listeners) | 7.19 M emits/sec |
| Targeted First Dispatch (Cold, Distinct Types) | 0.194 ms |
| Broadcast Flood (One Handler) | 23.91 M emits/sec |
| Broadcast First Dispatch (Cold, Distinct Types) | 0.269 ms |
| Interceptor Heavy (Four Interceptors) | 23.98 M emits/sec |
| Post-Processing Heavy (Four Post-Processors) | 19.46 M emits/sec |
| Message Bus Construction (1000) | 19.646 ms |
| Registration Token Construction (1000, Prebuilt Handler + Bus) | 0.046 ms |
| Registration Flood (1000 Types, Cold Bus) | 577.863 ms |
| Registration Flood (1000 Types, Warm JIT) | 3.351 ms |
| Untargeted Registration (Marginal, 1000 Same-Type) | 0.407 ms |
| Targeted Registration (Marginal, 1000 Same-Type) | 0.437 ms |
| Broadcast Registration (Marginal, 1000 Same-Type) | 0.440 ms |
| Deregistration Flood (1000 Types, Cold) | 1.650 ms |
| Deregistration Flood (1000 Types, Warm JIT) | 1.206 ms |
| Registration Attribution (Direct Bus, 131072) | 56.041 ms |
| Registration Attribution (Direct Handler, 131072) | 95.570 ms |
| Registration Attribution (Token Stage, 131072) | 11.368 ms |
| Registration Attribution (Token Active, 131072) | 114.808 ms |
| Deregistration Attribution (Direct Bus, 131072) | 6.998 ms |
| Deregistration Attribution (Direct Handler, 131072) | 28.919 ms |
| Deregistration Attribution (Token Remove, 131072) | 31.101 ms |
| Deregistration Attribution (Token Disable, 131072) | 34.575 ms |
Library comparison - throughput (Standalone (IL2CPP))¶
| Technology | Global -> 1 subscriber | Global -> 16 subscribers | Keyed/targeted -> 1 of many | Priority-ordered dispatch | Filtered/intercepted dispatch | Post-processing dispatch | Subscribe/unsubscribe churn | Struct message (no boxing) |
|---|---|---|---|---|---|---|---|---|
| DxMessaging | 36.32 M emits/sec | 16.29 M emits/sec | 10.00 M emits/sec | 23.62 M emits/sec | 25.64 M emits/sec | 20.18 M emits/sec | 0.94 M emits/sec | 28.63 M emits/sec |
| MessagePipe | 90.36 M emits/sec | 13.12 M emits/sec | 10.20 M emits/sec | N/A | 65.04 M emits/sec | 67.79 M emits/sec | 2.15 M emits/sec | 76.65 M emits/sec |
| UniRx MessageBroker | 4.54 M emits/sec | 2.39 M emits/sec | N/A | N/A | 4.23 M emits/sec | N/A | 1.02 M emits/sec | 4.27 M emits/sec |
| Zenject SignalBus | 2.38 M emits/sec | 1.19 M emits/sec | 2.13 M emits/sec | N/A | N/A | N/A | 1.71 M emits/sec | 2.41 M emits/sec |
| Unity Atoms | 170.67 M emits/sec | 42.65 M emits/sec | 194.55 M emits/sec | N/A | N/A | N/A | 10.17 M emits/sec | 202.52 M emits/sec |
| ScriptableObject channel | 119.33 M emits/sec | 20.81 M emits/sec | 175.91 M emits/sec | N/A | N/A | N/A | 24.68 M emits/sec | 173.86 M emits/sec |
| UnityEvent | 93.00 M emits/sec | 10.71 M emits/sec | 96.33 M emits/sec | N/A | N/A | N/A | 4.04 M emits/sec | 74.02 M emits/sec |
| C# event | 274.93 M emits/sec | 45.68 M emits/sec | 62.81 M emits/sec | N/A | N/A | N/A | 9.70 M emits/sec | 286.55 M emits/sec |
| Unity SendMessage | N/A | N/A | 7.83 M emits/sec | N/A | N/A | N/A | N/A | N/A |
Comparison libraries¶
The cross-library comparison matrices above measure DxMessaging against other common Unity messaging and eventing approaches on the same apples-to-apples scenarios:
- External libraries: MessagePipe, UniRx MessageBroker, Zenject SignalBus, and Unity Atoms.
- Zero-dependency baselines: plain C# event, UnityEvent, a ScriptableObject event channel, and Unity
SendMessage.
Each library implements only the scenarios it idiomatically supports; unsupported cells render N/A. The comparison suite source lives in Tests/Runtime/Comparisons/. For a feature-by-feature discussion of when each approach wins, see the Comparisons guide.
Memory footprint and reclamation¶
Dispatch state is stored per message type and, for targeted and broadcast paths, per InstanceId. Long-running sessions accumulate slots for every type or entity ever touched unless something reclaims them. The memory reclamation system caps that growth without changing dispatch semantics or allocating during emit.
Reclamation runs on two paths:
- An idle sweep that runs from emit-time clock samples and the Unity PlayerLoop, gated by
DxMessagingRuntimeSettings.EvictionEnabledandEvictionTickIntervalSeconds. Empty slots become eligible only after remaining empty for at leastIdleEvictionSecondsof wall time. - An explicit
IMessageBus.Trim(force)andMessageHandler.TrimAll(force)pair that runs synchronously at scene boundaries, in tests, or in maintenance windows. The master switchEnableTrimApicontrols whether the explicit calls perform work; idle sweeps remain controlled byEvictionEnabledindependently.
Active registrations are never reclaimed. Only empty slots and shared pool entries are touched. Sweep work runs outside the hot handler loop, so emit throughput is unaffected; the per-emit overhead is one branch that samples the wall clock.
For tuning recommendations, the public Trim and diagnostic-counter API surface, and worked examples (scene transitions, leak diagnosis, mobile caps, shipped-title configurations), see the Memory Reclamation guide. For the parameter reference, see the Runtime Settings reference.