Skip to content

Sample console app that shows performance difference while using result class vs exception

License

Notifications You must be signed in to change notification settings

crega/ResultObjectVsException

Repository files navigation

ResultObjectVsException

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.

You can change number of iterations freely in Program.cs on line 18

 public class SpeedComparisonBenchmark
        {
            private readonly long _numberOfIterations = 1_000_000;

To run benchmark position yourself in root of solution and run in terminal

dotnet run --project .\ResultObjectVsException.csproj -c Release

About

Sample console app that shows performance difference while using result class vs exception

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages