diff --git a/benchmarks/Benchmark.Behaviors/Benchmark.Behaviors.csproj b/benchmarks/Benchmark.Behaviors/Benchmark.Behaviors.csproj index 22c65a1a..3b023711 100644 --- a/benchmarks/Benchmark.Behaviors/Benchmark.Behaviors.csproj +++ b/benchmarks/Benchmark.Behaviors/Benchmark.Behaviors.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable enable diff --git a/benchmarks/Benchmark.Large/Benchmark.Large.csproj b/benchmarks/Benchmark.Large/Benchmark.Large.csproj index 22c65a1a..3b023711 100644 --- a/benchmarks/Benchmark.Large/Benchmark.Large.csproj +++ b/benchmarks/Benchmark.Large/Benchmark.Large.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable enable diff --git a/benchmarks/Benchmark.Simple/Benchmark.Simple.csproj b/benchmarks/Benchmark.Simple/Benchmark.Simple.csproj index 22c65a1a..3b023711 100644 --- a/benchmarks/Benchmark.Simple/Benchmark.Simple.csproj +++ b/benchmarks/Benchmark.Simple/Benchmark.Simple.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable enable diff --git a/readme.md b/readme.md index 92e686c5..c153adbd 100644 --- a/readme.md +++ b/readme.md @@ -198,11 +198,11 @@ All performance benchmarks reported use the following environment: ``` // * Summary * -BenchmarkDotNet v0.13.12, Windows 11 (10.0.22621.3007/22H2/2022Update/SunValley2) +BenchmarkDotNet v0.14.0, Windows 11 (10.0.22631.4317/23H2/2023Update/SunValley3) 12th Gen Intel Core i7-12700H, 1 CPU, 20 logical and 14 physical cores -.NET SDK 8.0.101 - [Host] : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX2 - DefaultJob : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX2 +.NET SDK 9.0.100 + [Host] : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2 + DefaultJob : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2 ``` #### [Benchmarks.Simple](./benchmarks/Benchmark.Simple) @@ -211,25 +211,25 @@ This benchmark tests the various mediator implementations with a single request/ | Method | Mean | Error | Ratio | Rank | Allocated | |----------------------------- |-----------:|----------:|------:|-----:|----------:| -| SendRequest_Baseline | 0.7701 ns | 0.0180 ns | 1.00 | 1 | - | -| SendRequest_IHandler | 15.6780 ns | 0.0476 ns | 20.36 | 2 | - | -| SendRequest_ImmediateHandler | 16.6023 ns | 0.0561 ns | 21.56 | 3 | - | -| SendRequest_Mediator | 27.2993 ns | 0.4269 ns | 35.49 | 4 | - | -| SendRequest_IMediator | 31.3420 ns | 0.1006 ns | 40.64 | 5 | - | -| SendRequest_MediatR | 68.3384 ns | 0.3453 ns | 88.73 | 6 | 240 B | +| SendRequest_Baseline | 0.6618 ns | 0.0127 ns | 1.00 | 1 | - | +| SendRequest_IHandler | 14.0497 ns | 0.0753 ns | 21.23 | 2 | - | +| SendRequest_ImmediateHandler | 14.9493 ns | 0.0818 ns | 22.59 | 3 | - | +| SendRequest_Mediator | 22.0218 ns | 0.0684 ns | 33.28 | 4 | - | +| SendRequest_IMediator | 26.8625 ns | 0.1428 ns | 40.60 | 5 | - | +| SendRequest_MediatR | 47.5135 ns | 0.4161 ns | 71.81 | 6 | 192 B | #### [Benchmarks.Large](./benchmarks/Benchmark.Large) This benchmark tests the various mediator implementations in the face of 999 request/response handlers. -| Method | Mean | Error | Ratio | Rank | Allocated | -|------------------------------ |------------:|----------:|-------:|-----:|----------:| -| SendRequest_Baseline | 0.5656 ns | 0.0252 ns | 1.00 | 1 | - | -| SendRequest_ImmediateHandler | 15.4346 ns | 0.0516 ns | 27.34 | 2 | - | -| SendRequest_IHandler | 16.0959 ns | 0.0552 ns | 28.50 | 3 | - | -| SendRequest_Mediator | 27.4104 ns | 0.0449 ns | 48.54 | 4 | - | -| SendRequest_MediatR | 80.0953 ns | 0.4749 ns | 141.83 | 5 | 240 B | -| SendRequest_IMediator | 435.3890 ns | 1.6399 ns | 771.01 | 6 | - | +| Method | Mean | Error | Ratio | Rank | Allocated | +|----------------------------- |------------:|----------:|-------:|-----:|----------:| +| SendRequest_Baseline | 0.6257 ns | 0.0202 ns | 1.00 | 1 | - | +| SendRequest_ImmediateHandler | 11.2358 ns | 0.0395 ns | 17.97 | 2 | - | +| SendRequest_IHandler | 14.0575 ns | 0.0652 ns | 22.49 | 3 | - | +| SendRequest_Mediator | 22.0874 ns | 0.0534 ns | 35.33 | 4 | - | +| SendRequest_MediatR | 48.3577 ns | 0.2402 ns | 77.35 | 5 | 192 B | +| SendRequest_IMediator | 420.2067 ns | 4.5092 ns | 672.17 | 6 | - | #### [Benchmarks.Behaviors](./benchmarks/Benchmark.Behaviors) @@ -237,9 +237,9 @@ This benchmark tests a more realistic scenario of using 1 behavior and 1 service | Method | Mean | Error | Ratio | Rank | Allocated | |----------------------------- |----------:|---------:|------:|-----:|----------:| -| SendRequest_Baseline | 56.71 ns | 0.174 ns | 1.00 | 1 | 40 B | -| SendRequest_IHandler | 78.90 ns | 0.304 ns | 1.39 | 2 | 40 B | -| SendRequest_ImmediateHandler | 80.02 ns | 0.288 ns | 1.41 | 3 | 40 B | -| SendRequest_Mediator | 101.23 ns | 0.263 ns | 1.78 | 4 | 40 B | -| SendRequest_IMediator | 104.92 ns | 0.297 ns | 1.85 | 5 | 40 B | -| SendRequest_MediatR | 201.27 ns | 1.023 ns | 3.55 | 6 | 560 B | +| SendRequest_Baseline | 47.83 ns | 0.160 ns | 1.00 | 1 | 40 B | +| SendRequest_ImmediateHandler | 62.67 ns | 0.350 ns | 1.31 | 2 | 40 B | +| SendRequest_IHandler | 63.59 ns | 0.218 ns | 1.33 | 2 | 40 B | +| SendRequest_Mediator | 91.53 ns | 0.292 ns | 1.91 | 3 | 40 B | +| SendRequest_IMediator | 100.73 ns | 0.396 ns | 2.11 | 4 | 40 B | +| SendRequest_MediatR | 188.54 ns | 0.785 ns | 3.94 | 5 | 560 B |