v8.0.6 - Improved performance
- Improved performance significantly.
BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3155/23H2/2023Update/SunValley3)
13th Gen Intel Core i7-13700KF, 1 CPU, 24 logical and 16 physical cores
.NET SDK 8.0.200
[Host] : .NET 8.0.2 (8.0.224.6711), X64 RyuJIT AVX2
DefaultJob : .NET 8.0.2 (8.0.224.6711), X64 RyuJIT AVX2
Iterations : 100 000
Method | Before | After | Difference | Before | After | Difference |
---|---|---|---|---|---|---|
ResultBase.Errors[0] |
51.91 μs | 27.53 μs | 89% faster | - | - | No change |
ResultBase.HasError<IError>() |
4,839.80 μs | 94.39 μs | 5027% faster | 12.21 MB | - | Eliminated |
Result.Ok() |
168.40 μs | 18.77 μs | 797% faster | 2.29 MB | - | Eliminated |
Result.Fail() |
1,195.60 μs | 18.88 μs | 6233% faster | 12.21 MB | - | Eliminated |
Result.Fail(IError) |
1,029.60 μs | 535.76 μs | 92% faster | 9.16 MB | 7.63 MB | 17% less |
Result.Ok<TValue>(TValue) |
195.30 μs | 196.74 μs | No change | 3.05 MB | 3.05 MB | No change |
Result.Fail<TValue>() |
1,251.30 μs | 19.06 μs | 6465% faster | 12.97 MB | - | Eliminated |
Result.Fail<TValue>(IError) |
1,013.10 μs | 558.52 μs | 81% faster | 9.92 MB | 8.39 MB | 15% less |
Result<TValue>.Ok(TValue) |
196.30 μs | 192.23 μs | No change | 3.05 MB | 3.05 MB | No change |
Result<TValue>.Fail() |
1,225.40 μs | 19.04 μs | 6336% faster | 12.97 MB | - | Eliminated |
Result<TValue>.Fail(IError) |
1,018.30 μs | 575.66 μs | 77% faster | 9.92 MB | 8.39 MB | 15% less |
new Error() |
225.80 μs | 223.80 μs | No change | 3.05 MB | 3.05 MB | No change |
new Error(errorMessage) |
224.40 μs | 225.02 μs | No change | 3.05 MB | 3.05 MB | No change |