Skip to content

Verdict

Result-based error handling for .NET that allocates nothing on the hot path, and still gives you the enterprise features you would otherwise reach for FluentResults to get.

dotnet add package Verdictcopy

The problem

Throwing exceptions for expected failures is enormously expensive. A failed validation is not exceptional, but you pay exception cost for it anyway, and in a hot path that cost dominates.

The usual escape is a result type, and in .NET that usually means FluentResults. It is a good library, but it allocates for every result. At a hundred thousand requests a second, those allocations become garbage collection pressure, and garbage collection pressure becomes cloud bill.

Verdict is the result type without the allocation.

What it does

  • Zero allocation on the success and failure paths.
  • Feature parity with FluentResults: multi-error validation, success and error metadata, an async fluent API.
  • Opt-in packages so the core stays small. You take ASP.NET Core integration or logging integration only if you want them.
  • Drop-in migration. Start with the core, add packages as you need them.

About the numbers

The repository's own BenchmarkDotNet suite puts Verdict at roughly 189x faster than FluentResults on the success path and 146x on the failure path, with 0 bytes allocated against their 176 to 368KB per thousand operations. Those are my benchmarks, run on an Apple M1, and you should treat them as a starting point rather than a promise. The benchmark code is in the repo, so run it on your own hardware against your own workload.

Where it fits

Anywhere failure is a normal outcome rather than an emergency: validation, parsing, domain rules, any API that returns "this input was wrong" more often than it returns "the database is on fire".

Brewed in the baryo ☕ · Released under the MIT License.