Example API

One API built ten ways, then measured.

The live results dashboard: pick an implementation, inspect it, read what each approach costs

The question

Does the architecture (Minimal API, MVC, Clean, MediatR, Vertical Slice) actually change performance? And on the same workload, how do .NET, Python and Node compare, and what does each one cost in code?

How it works

One OpenAPI contract, implemented ten ways: five in .NET, three in Python and two in TypeScript. A black-box conformance suite checks that every implementation behaves the same before anything is measured. k6 generates the load, and the results go to a public dashboard.

What I found

Within .NET, architecture hardly changes speed. The five styles range from 1 file and 382 lines to 48 files and 1,823 lines, yet their throughput stays within about 20% of each other. Across runtimes the concurrency model decides. Going from half a core to four, multi-threaded .NET gets about twelve times faster, while single-process Node levels off after about two cores and single-worker FastAPI stays flat. All the numbers come from one laptop, so treat them as relative, not absolute.

Architecture

  1. One OpenAPI contract
  2. 10 implementationsmy code
  3. Black-box conformance
  4. k6 load harness
  5. Results dashboard

Interactive benchmark

.NETTypeScriptPython◆ fastest
Throughput at 4 CPU cores (req/s). · median of 3 local k6 runs (repo docs/comparison.md); FastAPI’s 4-core point is its documented single-worker plateau.
Status
petrvalik.github.io/ExampleApi
Built with
.NETC#PythonTypeScriptOpenAPIk6Docker
Numbers
10implementations
~12×.NET, 0.5 to 4 cores
1744→329req/s at 1 CPU, best to worst
History
  1. Published the benchmark dashboard comparing ten implementations.