Skip to content

Minimal Request: The Cost of Doing Almost Nothing ​

Benchmark · November 2026 · Minimal request

Before you trust these numbers

  • The author of NpgsqlRest runs this benchmark, and NpgsqlRest is one of the services in it.
  • The analysis was written with AI assistance from the raw data, then reviewed and edited.
  • Every test ran once, on one machine. Treat differences of a few percent as a tie.
  • Everything is public so you can check it: the code of every service, the data, and everything that went wrong, and how to run it yourself. Corrections and pull requests are welcome.
Highlight:

What this test does ​

The service calls a function that returns one row with a status text and a timestamp. There are no parameters. Almost nothing is serialized, so what is measured is everything a request costs before any real work: accepting the connection, routing, getting a database connection from the pool, one round trip to PostgreSQL, and writing a small response.

It is run at 100, 200 and 500 users at the same time. This is the kind of test where the raw speed of a runtime shows most, and the one that matters least for choosing a tool, because no real endpoint does this little.

The code that ran: the load script scenarios/minimal-baseline.js, the PostgreSQL function in init.sql (for the NpgsqlRest SQL file services: perf-minimal.sql), and each service's own source, linked from Every Service, One Scorecard.

How to read the charts

  • A bar is requests answered per second. Longer is faster. The fastest service is at the top.
  • A "k6 limit" or "PG limit" tag means the load generator (k6, the tool that sends the requests) or the database ran out of CPU before the service did. That service could have gone faster than its bar shows.
  • The Highlight buttons above keep one platform highlighted in every chart of the series.

What the numbers say ​

  • Go is first at 100 and 200 users, Deno at 500. The top of this chart is a list of runtimes with cheap request handling: Go, Bun, Deno, .NET (as NpgsqlRest or hand-written with plain Npgsql) and Rust.
  • NpgsqlRest is within 7% of the leader with its JIT builds, on both versions. For a request this small, version 4.1 changes nothing: there was nothing left to remove.
  • This is where generated GraphQL costs most. Hasura does 3,824 requests per second and PostGraphile 11,505: parsing and planning a GraphQL document is most of a request that does nothing else.
  • Nothing held the services back here: in no test of this kind of test was the load generator or PostgreSQL out of CPU.

Of the 93 tests on this page, the service was out of CPU in 65, the load generator in 0, PostgreSQL in 0, and nothing in 28 (in those, the number of users set the pace, not a lack of CPU). A throughput number says how much a service can carry only where the service itself was out of CPU.

Compare the services ​

Pick a test with the buttons. Choose the number of users, and what to look at: requests per second, how slow the slowest requests are, memory, or requests per CPU core. The chart starts on the main test of this kind (100 users), which the summary tables of the series use.

Users at the same time
Show
Requests per second: 100 users

↑ longer bar is betterHow many requests each service answered per second, with 100 users sending requests at the same time.

  1. 1Go 1.27 · net/http61,391req/s
  2. 2Gin 1.12 (Go)60,090req/s
  3. 3Bun 1.458,354req/s
  4. 4NpgsqlRest 3.21 JIT · SQL files57,336req/s
  5. 5NpgsqlRest 3.21 JIT · functions57,280req/s
  6. 6NpgsqlRest 4.1 JIT · functions57,264req/s
  7. 7NpgsqlRest 4.1 JIT · SQL files57,187req/s
  8. 8Deno 2.956,615req/s
  9. 9.NET 10 · plain Npgsql56,471req/s
  10. 10.NET 10 · Dapper54,262req/s
  11. 11NpgsqlRest 3.21 AOT · functions53,859req/s
  12. 12NpgsqlRest 4.1 AOT · functions51,786req/s
  13. 13NpgsqlRest 3.21 AOT · SQL files51,417req/s
  14. 14.NET 11 · Dapper50,728req/s
  15. 15NpgsqlRest 4.1 AOT · SQL files49,846req/s
  16. 16.NET 11 · plain Npgsql49,416req/s
  17. 17Actix-web 4.20 (Rust)45,486req/s
  18. 18Axum 0.8 (Rust)44,570req/s
  19. 19Fastify 5.1241,679req/s
  20. 20Spring Boot 4.2 (Java 25)36,662req/s
  21. 21Express 5.329,164req/s
  22. 22Swoole 6.2 (PHP)26,918req/s
  23. 23NestJS 12.626,905req/s
  24. 24.NET 11 · EF Core15,730req/s
  25. 25.NET 10 · EF Core15,376req/s
  26. 26FastAPI 0.16511,629req/s
  27. 27PostGraphile 5.2 (GraphQL)11,505req/s
  28. 28PostgREST 16.67,655req/s
  29. 29Hasura 2.50 (GraphQL)3,824req/s
  30. 30Django 6.12,573req/s
  31. 31Laravel Octane 13.431,991req/s

The code of this test:the script that sends the requests · the PostgreSQL function it calls · the same as a SQL file. Click a service's name (↗) to open its own code for this test.

At 100 users at the same time, Go 1.27 · net/http is first with 61,391 requests per second, 2.2% ahead of Gin 1.12 (Go). 9 of the 31 services are within 10% of the leader, and the slowest does 1,991.

The best of each platform ​

The fastest service of every platform in the main test (100 users). "Compared with the fastest" is its requests per second as a percentage of the service in first place.

PlatformIts fastest servicePlace among the 31Requests per secondCompared with the fastestIts code
GoGo 1.27 · net/http161,391100%main.go
Bun & DenoBun 1.4358,35495%app.ts
NpgsqlRestNpgsqlRest 3.21 JIT · SQL files457,33693%appsettings.json
.NET.NET 10 · plain Npgsql956,47192%Program.cs
RustActix-web 4.20 (Rust)1745,48674%main.rs
Node.jsFastify 5.121941,67968%app.js
JavaSpring Boot 4.2 (Java 25)2036,66260%Application.java
PHPSwoole 6.2 (PHP)2226,91844%server.php
PythonFastAPI 0.1652611,62919%app.py
GraphQLPostGraphile 5.2 (GraphQL)2711,50519%graphile.config.mjs
PostgRESTPostgREST 16.6287,65512%postgrest.conf

Every measurement of the main test ​

Latency, CPU, memory and time in PostgreSQL for all 31 services
#ServiceRequests/sMedian msp99 msCPU cores usedRequests/s per corePeak memory MBTime in PostgreSQLOut of CPU
1Go 1.27 · net/http61,3911.125.03.3518,329430%—
2Gin 1.12 (Go)60,0901.145.13.3218,096430%—
3Bun 1.458,3541.304.43.5016,6801610%service
4NpgsqlRest 3.21 JIT · SQL files57,3361.315.23.5915,9831340%service
5NpgsqlRest 3.21 JIT · functions57,2801.374.53.5316,2301310%service
6NpgsqlRest 4.1 JIT · functions57,2641.324.73.1618,142930%—
7NpgsqlRest 4.1 JIT · SQL files57,1871.354.63.1218,3521010%—
8Deno 2.956,6151.364.13.5416,0063170%service
9.NET 10 · plain Npgsql56,4711.404.43.5815,774900%service
10.NET 10 · Dapper54,2621.454.53.5215,3961080%service
11NpgsqlRest 3.21 AOT · functions53,8591.494.43.6014,975720%service
12NpgsqlRest 4.1 AOT · functions51,7861.525.03.4614,955480%service
13NpgsqlRest 3.21 AOT · SQL files51,4171.377.63.5614,437810%service
14.NET 11 · Dapper50,7281.594.83.5014,4841140%service
15NpgsqlRest 4.1 AOT · SQL files49,8461.368.23.3614,856610%—
16.NET 11 · plain Npgsql49,4161.427.63.2015,438910%—
17Actix-web 4.20 (Rust)45,4861.824.03.5512,795310%service
18Axum 0.8 (Rust)44,5701.904.23.5312,628190%service
19Fastify 5.1241,6791.964.33.6211,5074020%service
20Spring Boot 4.2 (Java 25)36,6621.8712.03.5910,2121,1610%service
21Express 5.329,1642.905.23.837,6174330%service
22Swoole 6.2 (PHP)26,9183.474.53.667,357720%service
23NestJS 12.626,9053.195.43.757,1694710%service
24.NET 11 · EF Core15,7305.5211.63.784,1651530%service
25.NET 10 · EF Core15,3765.7710.53.834,0171430%service
26FastAPI 0.16511,6297.4214.83.833,0382910%service
27PostGraphile 5.2 (GraphQL)11,5056.9924.83.842,9948510%service
28PostgREST 16.67,65512.6714.53.052,511830%—
29Hasura 2.50 (GraphQL)3,82425.6132.82.191,7461940%—
30Django 6.12,57336.6152.23.387613540%—
31Laravel Octane 13.431,99141.9292.93.675425610%service

"CPU cores used" is the average CPU of the service during the test (it may use 4). "Time in PostgreSQL" is the share of an average request that PostgreSQL spent executing the statement.

All tests of this kind ​

Requests per second of every service in every test of this kind. Each column is one test; a higher number is better.

Service100 users200 users500 users
Go 1.27 · net/http61,39160,52757,275
Gin 1.12 (Go)60,09059,67156,625
Bun 1.458,35457,42058,259
NpgsqlRest 3.21 JIT · SQL files57,33655,99753,114
NpgsqlRest 3.21 JIT · functions57,28056,45153,431
NpgsqlRest 4.1 JIT · functions57,26458,88654,156
NpgsqlRest 4.1 JIT · SQL files57,18756,83153,733
Deno 2.956,61558,54061,197
.NET 10 · plain Npgsql56,47155,47853,188
.NET 10 · Dapper54,26255,82350,779
NpgsqlRest 3.21 AOT · functions53,85954,78950,341
NpgsqlRest 4.1 AOT · functions51,78651,61349,187
NpgsqlRest 3.21 AOT · SQL files51,41754,47550,419
.NET 11 · Dapper50,72849,84846,909
NpgsqlRest 4.1 AOT · SQL files49,84652,30049,539
.NET 11 · plain Npgsql49,41651,35348,841
Actix-web 4.20 (Rust)45,48648,08147,664
Axum 0.8 (Rust)44,57050,38449,728
Fastify 5.1241,67943,18039,824
Spring Boot 4.2 (Java 25)36,66235,33732,348
Express 5.329,16429,80828,517
Swoole 6.2 (PHP)26,91827,39027,246
NestJS 12.626,90527,05026,022
.NET 11 · EF Core15,73015,96215,132
.NET 10 · EF Core15,37615,70115,672
FastAPI 0.16511,62911,81511,556
PostGraphile 5.2 (GraphQL)11,50511,23311,188
PostgREST 16.67,6557,2616,807
Hasura 2.50 (GraphQL)3,8243,6653,483
Django 6.12,5732,4772,416
Laravel Octane 13.431,9911,9932,006

Bold is the best of the column. ᵏ the load generator was out of CPU in that test and the service was not; ᵖ the same for PostgreSQL.


Previous: ← Data Types · Next: POST Body →

Comments