Releases: jscarle/LightResults
Releases · jscarle/LightResults
v8.0.9 - Really final release for .NET 8.0
- Improved performance.
- Reduced interface on
result.Errors
down toIReadOnlyCollection<T>
. - Added dedicated property
result.Error
for direct access to first error in a failed result.
This is the really final release for .NET 8.0.
v8.0.8 - Final release for .NET 8.0
- Moved
IActionableResult
into theLightResults.Common
namespace.
This is the final release for .NET 8.0.
v8.0.7 - Further improved performance
- Further improved performance of ToString() methods.
See the full performance comparison.
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 |
v8.0.5 - Improved usability
- Added the first error message when available to the
ToString()
of failed results. - Reverted the
IResult.Errors
property back toIReadOnlyList<IError>
fromIReadOnlyCollection<IError>
for better performance.
v8.0.4 - Improved performance and usability
- Changed the
IResult.Errors
property fromIReadOnlyList<IError>
toIReadOnlyCollection<IError>
. - Improved the performance of
ResultBase.ToString()
. - Added
Result<TValue>.ToString()
in order to include the value when theTValue
is a primitive type. - Added new
Result.Fail
overloads:Result.Fail(string errorMessage, (string Key, object Value) metadata)
Result.Fail(string errorMessage, IDictionary<string, object> metadata)
Result.Fail<TValue>(string errorMessage, (string Key, object Value) metadata)
Result.Fail<TValue>(string errorMessage, IDictionary<string, object> metadata)
Result<TValue>.Fail(string errorMessage, (string Key, object Value) metadata)
Result<TValue>.Fail(string errorMessage, IDictionary<string, object> metadata)
- Used
FrozenDictionary
instead ofImmutableDictionary
for metadata in .NET 8.0. - Updated project dependencies.