Skip to content

Commit fc12f05

Browse files
committed
Add perf section to main readme
This section compares Merq to MediatR
1 parent 7e0e957 commit fc12f05

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

readme.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,35 @@ builder.Services.AddServices();
411411

412412
<!-- #duck -->
413413

414+
<!-- #perf -->
415+
# Performance
416+
417+
The performance of Merq is on par with the best implementations of the
418+
the same pattern, for example [MediatR](https://www.nuget.org/packages/mediatr).
419+
Note it sacrifices (minimally) performance for fewer allocations, most
420+
notably for the synchronous command execution path:
421+
422+
<!-- include ./src/Merq.Benchmarks/BenchmarkDotNet.Artifacts/results/Merq.MerqVsMediatR.Benchmark-report-github.md -->
423+
```
424+
425+
BenchmarkDotNet v0.13.12, Windows 11 (10.0.22622.575)
426+
Intel Core i9-10900T CPU 1.90GHz, 1 CPU, 20 logical and 10 physical cores
427+
.NET SDK 9.0.100-preview.2.24074.1
428+
[Host] : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX2
429+
DefaultJob : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX2
430+
431+
432+
```
433+
| Method | Mean | Error | StdDev | Median | Gen0 | Allocated |
434+
|-------------- |---------:|--------:|---------:|---------:|-------:|----------:|
435+
| PingMerq | 303.8 ns | 6.05 ns | 15.84 ns | 302.7 ns | 0.0172 | 184 B |
436+
| PingMerqAsync | 294.7 ns | 5.35 ns | 5.95 ns | 295.2 ns | 0.0248 | 264 B |
437+
| PingMediatR | 166.8 ns | 3.15 ns | 6.99 ns | 164.2 ns | 0.0319 | 336 B |
438+
439+
<!-- ./src/Merq.Benchmarks/BenchmarkDotNet.Artifacts/results/Merq.MerqVsMediatR.Benchmark-report-github.md -->
440+
441+
<!-- #perf -->
442+
414443
<!-- #ci -->
415444

416445
# Dogfooding
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
```
2+
3+
BenchmarkDotNet v0.13.12, Windows 11 (10.0.22622.575)
4+
Intel Core i9-10900T CPU 1.90GHz, 1 CPU, 20 logical and 10 physical cores
5+
.NET SDK 9.0.100-preview.2.24074.1
6+
[Host] : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX2
7+
DefaultJob : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX2
8+
9+
10+
```
11+
| Method | Mean | Error | StdDev | Median | Gen0 | Allocated |
12+
|-------------- |---------:|--------:|---------:|---------:|-------:|----------:|
13+
| PingMerq | 303.8 ns | 6.05 ns | 15.84 ns | 302.7 ns | 0.0172 | 184 B |
14+
| PingMerqAsync | 294.7 ns | 5.35 ns | 5.95 ns | 295.2 ns | 0.0248 | 264 B |
15+
| PingMediatR | 166.8 ns | 3.15 ns | 6.99 ns | 164.2 ns | 0.0319 | 336 B |

0 commit comments

Comments
 (0)