@@ -4,7 +4,7 @@ Foundatio.Mediator aims to get as close to direct method call performance as pos
44
55## Benchmark Results
66
7- > 📊 ** Last Updated:** 2026-01-09
7+ > 📊 ** Last Updated:** 2026-01-12
88
99### Commands
1010
@@ -14,13 +14,13 @@ Fire-and-forget dispatch with no return value.
1414<thead >
1515<tr ><th style =" text-align :left " >Method</th ><th style =" text-align :right ;white-space :nowrap " >Mean</th ><th style =" text-align :right ;white-space :nowrap " >Allocated</th ></tr >
1616</thead >
17- <tbody ><tr ><td style =" width :100% " ><code >Direct_Command</code ></td ><td style =" text-align :right ;white-space :nowrap " >0.0018 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
18- <tr ><td style =" width :100% " ><code >Foundatio_Command </code ></td ><td style =" text-align :right ;white-space :nowrap " >7.7535 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
19- <tr ><td style =" width :100% " ><code >MediatorNet_Command </code ></td ><td style =" text-align :right ;white-space :nowrap " >8.7615 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
20- <tr ><td style =" width :100% " ><code >ImmediateHandlers_Command</code ></td ><td style =" text-align :right ;white-space :nowrap " >11.5821 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
21- <tr ><td style =" width :100% " ><code >MediatR_Command</code ></td ><td style =" text-align :right ;white-space :nowrap " >34.8951 ns</td ><td style =" text-align :right ;white-space :nowrap " >128 B</td ></tr >
22- <tr ><td style =" width :100% " ><code >Wolverine_Command</code ></td ><td style =" text-align :right ;white-space :nowrap " >191.5925 ns</td ><td style =" text-align :right ;white-space :nowrap " >704 B</td ></tr >
23- <tr ><td style =" width :100% " ><code >MassTransit_Command</code ></td ><td style =" text-align :right ;white-space :nowrap " >1,894.2028 ns</td ><td style =" text-align :right ;white-space :nowrap " >4,912 B</td ></tr >
17+ <tbody ><tr ><td style =" width :100% " ><code >Direct_Command</code ></td ><td style =" text-align :right ;white-space :nowrap " >0.0013 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
18+ <tr ><td style =" width :100% " ><code >MediatorNet_Command </code ></td ><td style =" text-align :right ;white-space :nowrap " >8.5376 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
19+ <tr ><td style =" width :100% " ><code >Foundatio_Command </code ></td ><td style =" text-align :right ;white-space :nowrap " >8.6441 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
20+ <tr ><td style =" width :100% " ><code >ImmediateHandlers_Command</code ></td ><td style =" text-align :right ;white-space :nowrap " >12.6829 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
21+ <tr ><td style =" width :100% " ><code >MediatR_Command</code ></td ><td style =" text-align :right ;white-space :nowrap " >35.3448 ns</td ><td style =" text-align :right ;white-space :nowrap " >128 B</td ></tr >
22+ <tr ><td style =" width :100% " ><code >Wolverine_Command</code ></td ><td style =" text-align :right ;white-space :nowrap " >181.7438 ns</td ><td style =" text-align :right ;white-space :nowrap " >704 B</td ></tr >
23+ <tr ><td style =" width :100% " ><code >MassTransit_Command</code ></td ><td style =" text-align :right ;white-space :nowrap " >1,848.3264 ns</td ><td style =" text-align :right ;white-space :nowrap " >4,912 B</td ></tr >
2424</tbody >
2525</table >
2626
@@ -32,14 +32,14 @@ Request/response dispatch returning an Order object.
3232<thead >
3333<tr ><th style =" text-align :left " >Method</th ><th style =" text-align :right ;white-space :nowrap " >Mean</th ><th style =" text-align :right ;white-space :nowrap " >Allocated</th ></tr >
3434</thead >
35- <tbody ><tr ><td style =" width :100% " ><code >Direct_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >21.4985 ns</td ><td style =" text-align :right ;white-space :nowrap " >48 B</td ></tr >
36- <tr ><td style =" width :100% " ><code >MediatorNet_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >25.9325 ns</td ><td style =" text-align :right ;white-space :nowrap " >48 B</td ></tr >
37- <tr ><td style =" width :100% " ><code >Foundatio_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >29.4850 ns</td ><td style =" text-align :right ;white-space :nowrap " >48 B</td ></tr >
38- <tr ><td style =" width :100% " ><code >ImmediateHandlers_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >31.3242 ns</td ><td style =" text-align :right ;white-space :nowrap " >48 B</td ></tr >
39- <tr ><td style =" width :100% " ><code >MediatR_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >54.1867 ns</td ><td style =" text-align :right ;white-space :nowrap " >248 B</td ></tr >
40- <tr ><td style =" width :100% " ><code >MediatR_QueryWithDependencies</code ></td ><td style =" text-align :right ;white-space :nowrap " >134.4035 ns</td ><td style =" text-align :right ;white-space :nowrap " >600 B</td ></tr >
41- <tr ><td style =" width :100% " ><code >Wolverine_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >270.7645 ns</td ><td style =" text-align :right ;white-space :nowrap " >864 B</td ></tr >
42- <tr ><td style =" width :100% " ><code >MassTransit_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >6,860.7615 ns</td ><td style =" text-align :right ;white-space :nowrap " >13,144 B</td ></tr >
35+ <tbody ><tr ><td style =" width :100% " ><code >Direct_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >21.5555 ns</td ><td style =" text-align :right ;white-space :nowrap " >48 B</td ></tr >
36+ <tr ><td style =" width :100% " ><code >MediatorNet_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >25.0868 ns</td ><td style =" text-align :right ;white-space :nowrap " >48 B</td ></tr >
37+ <tr ><td style =" width :100% " ><code >Foundatio_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >27.6418 ns</td ><td style =" text-align :right ;white-space :nowrap " >48 B</td ></tr >
38+ <tr ><td style =" width :100% " ><code >ImmediateHandlers_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >29.2755 ns</td ><td style =" text-align :right ;white-space :nowrap " >48 B</td ></tr >
39+ <tr ><td style =" width :100% " ><code >MediatR_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >51.6547 ns</td ><td style =" text-align :right ;white-space :nowrap " >248 B</td ></tr >
40+ <tr ><td style =" width :100% " ><code >MediatR_QueryWithDependencies</code ></td ><td style =" text-align :right ;white-space :nowrap " >129.8894 ns</td ><td style =" text-align :right ;white-space :nowrap " >600 B</td ></tr >
41+ <tr ><td style =" width :100% " ><code >Wolverine_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >253.5854 ns</td ><td style =" text-align :right ;white-space :nowrap " >864 B</td ></tr >
42+ <tr ><td style =" width :100% " ><code >MassTransit_Query</code ></td ><td style =" text-align :right ;white-space :nowrap " >5,449.3080 ns</td ><td style =" text-align :right ;white-space :nowrap " >13,144 B</td ></tr >
4343</tbody >
4444</table >
4545
@@ -51,13 +51,13 @@ Notification dispatched to 2 handlers.
5151<thead >
5252<tr ><th style =" text-align :left " >Method</th ><th style =" text-align :right ;white-space :nowrap " >Mean</th ><th style =" text-align :right ;white-space :nowrap " >Allocated</th ></tr >
5353</thead >
54- <tbody ><tr ><td style =" width :100% " ><code >Direct_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >0.0046 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
55- <tr ><td style =" width :100% " ><code >MediatorNet_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >6.2083 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
56- <tr ><td style =" width :100% " ><code >Foundatio_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >29.6835 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
57- <tr ><td style =" width :100% " ><code >ImmediateHandlers_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >54.4492 ns</td ><td style =" text-align :right ;white-space :nowrap " >32 B</td ></tr >
58- <tr ><td style =" width :100% " ><code >MediatR_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >56.4874 ns</td ><td style =" text-align :right ;white-space :nowrap " >440 B</td ></tr >
59- <tr ><td style =" width :100% " ><code >Wolverine_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >1,858.9299 ns</td ><td style =" text-align :right ;white-space :nowrap " >2,840 B</td ></tr >
60- <tr ><td style =" width :100% " ><code >MassTransit_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >3,019.7545 ns</td ><td style =" text-align :right ;white-space :nowrap " >7,456 B</td ></tr >
54+ <tbody ><tr ><td style =" width :100% " ><code >Direct_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >0.0000 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
55+ <tr ><td style =" width :100% " ><code >MediatorNet_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >5.6309 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
56+ <tr ><td style =" width :100% " ><code >Foundatio_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >26.2301 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
57+ <tr ><td style =" width :100% " ><code >ImmediateHandlers_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >52.0055 ns</td ><td style =" text-align :right ;white-space :nowrap " >32 B</td ></tr >
58+ <tr ><td style =" width :100% " ><code >MediatR_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >53.3701 ns</td ><td style =" text-align :right ;white-space :nowrap " >440 B</td ></tr >
59+ <tr ><td style =" width :100% " ><code >Wolverine_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >1,776.5620 ns</td ><td style =" text-align :right ;white-space :nowrap " >2,840 B</td ></tr >
60+ <tr ><td style =" width :100% " ><code >MassTransit_Publish</code ></td ><td style =" text-align :right ;white-space :nowrap " >2,846.1568 ns</td ><td style =" text-align :right ;white-space :nowrap " >7,456 B</td ></tr >
6161</tbody >
6262</table >
6363
@@ -69,12 +69,12 @@ Query where handler has an injected service (IOrderService) and timing middlewar
6969<thead >
7070<tr ><th style =" text-align :left " >Method</th ><th style =" text-align :right ;white-space :nowrap " >Mean</th ><th style =" text-align :right ;white-space :nowrap " >Allocated</th ></tr >
7171</thead >
72- <tbody ><tr ><td style =" width :100% " ><code >Direct_FullQuery</code ></td ><td style =" text-align :right ;white-space :nowrap " >64.3040 ns</td ><td style =" text-align :right ;white-space :nowrap " >160 B</td ></tr >
73- <tr ><td style =" width :100% " ><code >MediatorNet_FullQuery</code ></td ><td style =" text-align :right ;white-space :nowrap " >76.7475 ns</td ><td style =" text-align :right ;white-space :nowrap " >88 B</td ></tr >
74- <tr ><td style =" width :100% " ><code >ImmediateHandlers_FullQuery</code ></td ><td style =" text-align :right ;white-space :nowrap " >76.9550 ns</td ><td style =" text-align :right ;white-space :nowrap " >88 B</td ></tr >
75- <tr ><td style =" width :100% " ><code >Foundatio_FullQuery</code ></td ><td style =" text-align :right ;white-space :nowrap " >125.0594 ns</td ><td style =" text-align :right ;white-space :nowrap " >288 B</td ></tr >
76- <tr ><td style =" width :100% " ><code >Wolverine_FullQuery</code ></td ><td style =" text-align :right ;white-space :nowrap " >310.9703 ns</td ><td style =" text-align :right ;white-space :nowrap " >944 B</td ></tr >
77- <tr ><td style =" width :100% " ><code >MassTransit_FullQuery</code ></td ><td style =" text-align :right ;white-space :nowrap " >6,984.8064 ns</td ><td style =" text-align :right ;white-space :nowrap " >13,144 B</td ></tr >
72+ <tbody ><tr ><td style =" width :100% " ><code >Direct_FullQuery</code ></td ><td style =" text-align :right ;white-space :nowrap " >64.6228 ns</td ><td style =" text-align :right ;white-space :nowrap " >160 B</td ></tr >
73+ <tr ><td style =" width :100% " ><code >MediatorNet_FullQuery</code ></td ><td style =" text-align :right ;white-space :nowrap " >75.6508 ns</td ><td style =" text-align :right ;white-space :nowrap " >88 B</td ></tr >
74+ <tr ><td style =" width :100% " ><code >ImmediateHandlers_FullQuery</code ></td ><td style =" text-align :right ;white-space :nowrap " >78.1390 ns</td ><td style =" text-align :right ;white-space :nowrap " >88 B</td ></tr >
75+ <tr ><td style =" width :100% " ><code >Foundatio_FullQuery</code ></td ><td style =" text-align :right ;white-space :nowrap " >114.5151 ns</td ><td style =" text-align :right ;white-space :nowrap " >288 B</td ></tr >
76+ <tr ><td style =" width :100% " ><code >Wolverine_FullQuery</code ></td ><td style =" text-align :right ;white-space :nowrap " >321.1601 ns</td ><td style =" text-align :right ;white-space :nowrap " >944 B</td ></tr >
77+ <tr ><td style =" width :100% " ><code >MassTransit_FullQuery</code ></td ><td style =" text-align :right ;white-space :nowrap " >5,423.7609 ns</td ><td style =" text-align :right ;white-space :nowrap " >13,144 B</td ></tr >
7878</tbody >
7979</table >
8080
@@ -86,13 +86,13 @@ CreateOrder returns an Order and publishes OrderCreatedEvent to 2 handlers. Foun
8686<thead >
8787<tr ><th style =" text-align :left " >Method</th ><th style =" text-align :right ;white-space :nowrap " >Mean</th ><th style =" text-align :right ;white-space :nowrap " >Allocated</th ></tr >
8888</thead >
89- <tbody ><tr ><td style =" width :100% " ><code >Direct_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >27.9258 ns</td ><td style =" text-align :right ;white-space :nowrap " >144 B</td ></tr >
90- <tr ><td style =" width :100% " ><code >MediatorNet_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >37.5463 ns</td ><td style =" text-align :right ;white-space :nowrap " >72 B</td ></tr >
91- <tr ><td style =" width :100% " ><code >Foundatio_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >76.1077 ns</td ><td style =" text-align :right ;white-space :nowrap " >72 B</td ></tr >
92- <tr ><td style =" width :100% " ><code >ImmediateHandlers_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >84.0305 ns</td ><td style =" text-align :right ;white-space :nowrap " >104 B</td ></tr >
93- <tr ><td style =" width :100% " ><code >MediatR_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >117.5655 ns</td ><td style =" text-align :right ;white-space :nowrap " >744 B</td ></tr >
94- <tr ><td style =" width :100% " ><code >Wolverine_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >2,283.9439 ns</td ><td style =" text-align :right ;white-space :nowrap " >4,056 B</td ></tr >
95- <tr ><td style =" width :100% " ><code >MassTransit_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >9,479.0192 ns</td ><td style =" text-align :right ;white-space :nowrap " >20,848 B</td ></tr >
89+ <tbody ><tr ><td style =" width :100% " ><code >Direct_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >29.5387 ns</td ><td style =" text-align :right ;white-space :nowrap " >144 B</td ></tr >
90+ <tr ><td style =" width :100% " ><code >MediatorNet_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >38.1901 ns</td ><td style =" text-align :right ;white-space :nowrap " >72 B</td ></tr >
91+ <tr ><td style =" width :100% " ><code >Foundatio_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >80.4876 ns</td ><td style =" text-align :right ;white-space :nowrap " >72 B</td ></tr >
92+ <tr ><td style =" width :100% " ><code >ImmediateHandlers_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >84.0595 ns</td ><td style =" text-align :right ;white-space :nowrap " >104 B</td ></tr >
93+ <tr ><td style =" width :100% " ><code >MediatR_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >114.8168 ns</td ><td style =" text-align :right ;white-space :nowrap " >744 B</td ></tr >
94+ <tr ><td style =" width :100% " ><code >Wolverine_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >2,279.2468 ns</td ><td style =" text-align :right ;white-space :nowrap " >4,056 B</td ></tr >
95+ <tr ><td style =" width :100% " ><code >MassTransit_CascadingMessages</code ></td ><td style =" text-align :right ;white-space :nowrap " >8,762.3522 ns</td ><td style =" text-align :right ;white-space :nowrap " >20,848 B</td ></tr >
9696</tbody >
9797</table >
9898
@@ -104,13 +104,13 @@ Middleware returns cached result; handler is never invoked. Each library uses it
104104<thead >
105105<tr ><th style =" text-align :left " >Method</th ><th style =" text-align :right ;white-space :nowrap " >Mean</th ><th style =" text-align :right ;white-space :nowrap " >Allocated</th ></tr >
106106</thead >
107- <tbody ><tr ><td style =" width :100% " ><code >Direct_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >0.2548 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
108- <tr ><td style =" width :100% " ><code >MediatorNet_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >8.5877 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
109- <tr ><td style =" width :100% " ><code >ImmediateHandlers_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >9.6720 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
110- <tr ><td style =" width :100% " ><code >Foundatio_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >9.7259 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
111- <tr ><td style =" width :100% " ><code >MediatR_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >51.7768 ns</td ><td style =" text-align :right ;white-space :nowrap " >416 B</td ></tr >
112- <tr ><td style =" width :100% " ><code >Wolverine_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >230.5081 ns</td ><td style =" text-align :right ;white-space :nowrap " >824 B</td ></tr >
113- <tr ><td style =" width :100% " ><code >MassTransit_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >6,363.0741 ns</td ><td style =" text-align :right ;white-space :nowrap " >12,224 B</td ></tr >
107+ <tbody ><tr ><td style =" width :100% " ><code >Direct_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >0.2011 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
108+ <tr ><td style =" width :100% " ><code >MediatorNet_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >8.2288 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
109+ <tr ><td style =" width :100% " ><code >ImmediateHandlers_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >8.9665 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
110+ <tr ><td style =" width :100% " ><code >Foundatio_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >9.2548 ns</td ><td style =" text-align :right ;white-space :nowrap " >0 B</td ></tr >
111+ <tr ><td style =" width :100% " ><code >MediatR_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >49.5630 ns</td ><td style =" text-align :right ;white-space :nowrap " >416 B</td ></tr >
112+ <tr ><td style =" width :100% " ><code >Wolverine_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >208.3963 ns</td ><td style =" text-align :right ;white-space :nowrap " >824 B</td ></tr >
113+ <tr ><td style =" width :100% " ><code >MassTransit_ShortCircuit</code ></td ><td style =" text-align :right ;white-space :nowrap " >5,010.8619 ns</td ><td style =" text-align :right ;white-space :nowrap " >12,224 B</td ></tr >
114114</tbody >
115115</table >
116116
0 commit comments