This sample project is part of my blog post @littleCode created in order to visualize performance gap when using result object to return success or fail information and usage of exceptions to signalize success or failure of an action.
- It is using BenchmarkDotNet to benchmark methods performance.
- For Result pattern implementation I opted for FluentResults
You can change number of iterations freely in Program.cs
on line 18
public class SpeedComparisonBenchmark
{
private readonly long _numberOfIterations = 1_000_000;
dotnet run --project .\ResultObjectVsException.csproj -c Release