Many Parameters: Twenty Values in the Query String
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.
What this test does
The service receives 20 parameters in the query string (texts, integers, booleans and numerics, five of each kind in turn), passes them to a function and returns a count and a checksum. The response is tiny; the work is in parsing, converting and binding twenty values.
It is run at 50, 100 and 200 users at the same time.
The code that ran: the load script scenarios/many-params.js, the PostgreSQL function in init.sql (for the NpgsqlRest SQL file services: perf-many-params.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 or Gin is first in every test, about 12% ahead of Bun in third place.
- The service is the limit in almost every test here, so this is one of the cleanest comparisons of the series: twenty conversions per request is work that stays in the service.
- Parsing parameters is where the generated APIs differ most from each other. NpgsqlRest 4.1 (JIT, SQL files) does 43,266 requests per second, PostgREST 4,143, Hasura 2,873.
Of the 93 tests on this page, the service was out of CPU in 84, the load generator in 0, PostgreSQL in 0, and nothing in 9 (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 (50 users), which the summary tables of the series use.
↑ longer bar is betterHow many requests each service answered per second, with 50 users sending requests at the same time.
- 1Gin 1.12 (Go)50,908req/s
- 2Go 1.27 · net/http50,754req/s
- 3Bun 1.445,455req/s
- 4.NET 10 · plain Npgsql43,925req/s
- 5NpgsqlRest 4.1 JIT · SQL files43,266req/s
- 6NpgsqlRest 3.21 JIT · SQL files41,444req/s
- 7NpgsqlRest 4.1 JIT · functions41,129req/s
- 8Actix-web 4.20 (Rust)40,688req/s
- 9Axum 0.8 (Rust)40,309req/s
- 10Deno 2.940,023req/s
- 11NpgsqlRest 3.21 JIT · functions39,809req/s
- 12.NET 11 · plain Npgsql39,344req/s
- 13.NET 10 · Dapper38,647req/s
- 14NpgsqlRest 3.21 AOT · SQL files37,220req/s
- 15NpgsqlRest 4.1 AOT · functions37,165req/s
- 16Fastify 5.1237,037req/s
- 17NpgsqlRest 3.21 AOT · functions37,022req/s
- 18.NET 11 · Dapper37,020req/s
- 19NpgsqlRest 4.1 AOT · SQL files36,158req/s
- 20Express 5.326,353req/s
- 21NestJS 12.624,009req/s
- 22Swoole 6.2 (PHP)21,563req/s
- 23Spring Boot 4.2 (Java 25)17,658req/s
- 24.NET 11 · EF Core13,653req/s
- 25.NET 10 · EF Core12,934req/s
- 26PostGraphile 5.2 (GraphQL)9,483req/s
- 27FastAPI 0.1656,776req/s
- 28PostgREST 16.64,143req/s
- 29Hasura 2.50 (GraphQL)2,873req/s
- 30Django 6.12,403req/s
- 31Laravel Octane 13.431,639req/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 50 users at the same time, Gin 1.12 (Go) is first with 50,908 requests per second, 0.3% ahead of Go 1.27 · net/http. 2 of the 31 services are within 10% of the leader, and the slowest does 1,639.
The best of each platform
The fastest service of every platform in the main test (50 users). "Compared with the fastest" is its requests per second as a percentage of the service in first place.
| Platform | Its fastest service | Place among the 31 | Requests per second | Compared with the fastest | Its code |
|---|---|---|---|---|---|
| Go | Gin 1.12 (Go) | 1 | 50,908 | 100% | main.go |
| Bun & Deno | Bun 1.4 | 3 | 45,455 | 89% | app.ts |
| .NET | .NET 10 · plain Npgsql | 4 | 43,925 | 86% | Program.cs |
| NpgsqlRest | NpgsqlRest 4.1 JIT · SQL files | 5 | 43,266 | 85% | appsettings.json |
| Rust | Actix-web 4.20 (Rust) | 8 | 40,688 | 80% | main.rs |
| Node.js | Fastify 5.12 | 16 | 37,037 | 73% | app.js |
| PHP | Swoole 6.2 (PHP) | 22 | 21,563 | 42% | server.php |
| Java | Spring Boot 4.2 (Java 25) | 23 | 17,658 | 35% | Application.java |
| GraphQL | PostGraphile 5.2 (GraphQL) | 26 | 9,483 | 19% | graphile.config.mjs |
| Python | FastAPI 0.165 | 27 | 6,776 | 13% | app.py |
| PostgREST | PostgREST 16.6 | 28 | 4,143 | 8% | postgrest.conf |
Every measurement of the main test
Latency, CPU, memory and time in PostgreSQL for all 31 services
| # | Service | Requests/s | Median ms | p99 ms | CPU cores used | Requests/s per core | Peak memory MB | Time in PostgreSQL | Out of CPU |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Gin 1.12 (Go) | 50,908 | 0.70 | 2.8 | 3.52 | 14,467 | 32 | 3% | service |
| 2 | Go 1.27 · net/http | 50,754 | 0.70 | 2.9 | 3.52 | 14,439 | 34 | 4% | service |
| 3 | Bun 1.4 | 45,455 | 0.87 | 2.9 | 3.60 | 12,618 | 162 | 3% | service |
| 4 | .NET 10 · plain Npgsql | 43,925 | 0.90 | 2.6 | 3.70 | 11,887 | 254 | 0% | service |
| 5 | NpgsqlRest 4.1 JIT · SQL files | 43,266 | 0.79 | 4.6 | 3.26 | 13,267 | 191 | 0% | — |
| 6 | NpgsqlRest 3.21 JIT · SQL files | 41,444 | 0.98 | 2.6 | 3.74 | 11,072 | 394 | 0% | service |
| 7 | NpgsqlRest 4.1 JIT · functions | 41,129 | 0.85 | 4.5 | 3.29 | 12,498 | 194 | 0% | — |
| 8 | Actix-web 4.20 (Rust) | 40,688 | 1.01 | 1.9 | 3.66 | 11,116 | 82 | 0% | service |
| 9 | Axum 0.8 (Rust) | 40,309 | 1.06 | 1.8 | 3.54 | 11,379 | 37 | 0% | service |
| 10 | Deno 2.9 | 40,023 | 1.06 | 2.2 | 3.72 | 10,765 | 390 | 3% | service |
| 11 | NpgsqlRest 3.21 JIT · functions | 39,809 | 1.02 | 2.6 | 3.73 | 10,684 | 367 | 0% | service |
| 12 | .NET 11 · plain Npgsql | 39,344 | 0.91 | 4.5 | 3.31 | 11,892 | 281 | 0% | — |
| 13 | .NET 10 · Dapper | 38,647 | 0.90 | 7.0 | 3.76 | 10,270 | 275 | 0% | service |
| 14 | NpgsqlRest 3.21 AOT · SQL files | 37,220 | 0.92 | 7.9 | 3.75 | 9,923 | 347 | 0% | service |
| 15 | NpgsqlRest 4.1 AOT · functions | 37,165 | 1.08 | 2.9 | 3.66 | 10,146 | 118 | 0% | service |
| 16 | Fastify 5.12 | 37,037 | 1.21 | 2.2 | 3.73 | 9,933 | 541 | 0% | service |
| 17 | NpgsqlRest 3.21 AOT · functions | 37,022 | 1.11 | 2.7 | 3.66 | 10,106 | 305 | 0% | service |
| 18 | .NET 11 · Dapper | 37,020 | 1.08 | 3.3 | 3.52 | 10,522 | 280 | 0% | service |
| 19 | NpgsqlRest 4.1 AOT · SQL files | 36,158 | 0.93 | 6.7 | 3.47 | 10,427 | 190 | 0% | service |
| 20 | Express 5.3 | 26,353 | 1.63 | 2.9 | 3.78 | 6,964 | 613 | 0% | service |
| 21 | NestJS 12.6 | 24,009 | 1.73 | 3.0 | 3.71 | 6,465 | 672 | 0% | service |
| 22 | Swoole 6.2 (PHP) | 21,563 | 2.09 | 2.7 | 3.71 | 5,807 | 140 | 0% | service |
| 23 | Spring Boot 4.2 (Java 25) | 17,658 | 2.47 | 6.1 | 3.79 | 4,663 | 1,302 | 2% | service |
| 24 | .NET 11 · EF Core | 13,653 | 3.05 | 7.0 | 3.75 | 3,639 | 294 | 0% | service |
| 25 | .NET 10 · EF Core | 12,934 | 2.82 | 12.5 | 3.83 | 3,381 | 290 | 0% | service |
| 26 | PostGraphile 5.2 (GraphQL) | 9,483 | 4.26 | 10.4 | 3.83 | 2,474 | 1,120 | 1% | service |
| 27 | FastAPI 0.165 | 6,776 | 6.89 | 9.0 | 3.91 | 1,733 | 296 | 0% | service |
| 28 | PostgREST 16.6 | 4,143 | 11.09 | 16.9 | 2.59 | 1,597 | 65 | 1% | — |
| 29 | Hasura 2.50 (GraphQL) | 2,873 | 16.91 | 23.7 | 2.30 | 1,251 | 203 | 0% | — |
| 30 | Django 6.1 | 2,403 | 19.32 | 32.4 | 3.49 | 689 | 472 | 0% | service |
| 31 | Laravel Octane 13.43 | 1,639 | 25.69 | 58.2 | 3.82 | 429 | 883 | 0% | 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.
| Service | 50 users | 100 users | 200 users |
|---|---|---|---|
| Gin 1.12 (Go) | 50,908 | 52,254 | 51,464 |
| Go 1.27 · net/http | 50,754 | 52,709 | 51,700 |
| Bun 1.4 | 45,455 | 47,042 | 47,048 |
| .NET 10 · plain Npgsql | 43,925 | 46,445 | 48,111 |
| NpgsqlRest 4.1 JIT · SQL files | 43,266 | 46,733 | 45,912 |
| NpgsqlRest 3.21 JIT · SQL files | 41,444 | 42,990 | 43,278 |
| NpgsqlRest 4.1 JIT · functions | 41,129 | 43,952 | 43,811 |
| Actix-web 4.20 (Rust) | 40,688 | 43,327 | 45,528 |
| Axum 0.8 (Rust) | 40,309 | 41,837 | 46,533 |
| Deno 2.9 | 40,023 | 44,255 | 46,601 |
| NpgsqlRest 3.21 JIT · functions | 39,809 | 40,181 | 41,578 |
| .NET 11 · plain Npgsql | 39,344 | 43,314 | 43,100 |
| .NET 10 · Dapper | 38,647 | 41,816 | 43,027 |
| NpgsqlRest 3.21 AOT · SQL files | 37,220 | 39,038 | 39,583 |
| NpgsqlRest 4.1 AOT · functions | 37,165 | 37,864 | 38,522 |
| Fastify 5.12 | 37,037 | 39,294 | 40,165 |
| NpgsqlRest 3.21 AOT · functions | 37,022 | 38,136 | 39,484 |
| .NET 11 · Dapper | 37,020 | 39,239 | 38,777 |
| NpgsqlRest 4.1 AOT · SQL files | 36,158 | 39,869 | 39,553 |
| Express 5.3 | 26,353 | 27,431 | 28,117 |
| NestJS 12.6 | 24,009 | 25,019 | 25,184 |
| Swoole 6.2 (PHP) | 21,563 | 21,640 | 21,835 |
| Spring Boot 4.2 (Java 25) | 17,658 | 17,796 | 17,830 |
| .NET 11 · EF Core | 13,653 | 13,914 | 13,804 |
| .NET 10 · EF Core | 12,934 | 13,431 | 13,516 |
| PostGraphile 5.2 (GraphQL) | 9,483 | 8,770 | 8,792 |
| FastAPI 0.165 | 6,776 | 7,143 | 7,245 |
| PostgREST 16.6 | 4,143 | 4,126 | 4,066 |
| Hasura 2.50 (GraphQL) | 2,873 | 2,769 | 2,674 |
| Django 6.1 | 2,403 | 2,311 | 2,283 |
| Laravel Octane 13.43 | 1,639 | 1,638 | 1,650 |
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: ← Large Payload · Next: Tables →