Skip to content

Commit

Permalink
Update Benchmark results for net9
Browse files Browse the repository at this point in the history
  • Loading branch information
viceroypenguin committed Nov 13, 2024
1 parent d6f20fa commit 0b1ecef
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion benchmarks/Benchmark.Behaviors/Benchmark.Behaviors.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Benchmark.Large/Benchmark.Large.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Benchmark.Simple/Benchmark.Simple.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
48 changes: 24 additions & 24 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -211,35 +211,35 @@ 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)

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 |

0 comments on commit 0b1ecef

Please sign in to comment.