Tables: Lookups, List Pages and Inserts
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 these tests do
Three kinds of test that read and write real tables. The other six call functions that compute their result in memory, which isolates the framework; these three are what most endpoints of a real API do. They are new in this round.
- Row by key: one row of a 500,000 row table, by primary key. Every request asks for a different row.
- Page of a list: 20 rows of one category after a given id, through an index (keyset pagination). Every request asks for a different page.
- Insert: one insert that returns the new row. The table is emptied before each test, so every service writes into a table of the same size.
Each is run at 50 and 200 users at the same time. Every service calls the same three functions, so the SQL that runs is the same for all. The data (54 MB with its indexes) fits in memory, as the hot data of a well-sized production database does.
The code that ran: the functions and the table in tables.sql, the load script lib/table.js, the statements of the NpgsqlRest SQL file services in _sql_files, 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
- The ranking on real tables is close to the ranking on functions. Go leads the lookup by key, with NpgsqlRest 4.1 (JIT, SQL files) third, 2% behind.
- NpgsqlRest 4.1 is first on list pages, with its two JIT builds, ahead of hand-written .NET with plain Npgsql. Twenty typed rows per response is the shape of request it was optimized for.
- Inserts are the most even of the three: 13 services are within 15% of the leader at 50 users. The database does more of the work, so the frameworks matter less.
- The slow group is the same as everywhere else: PostgREST, Hasura, Django and Laravel Octane are between 1,878 and 7,202 requests per second on the lookup, where the leader does 54,910.
Of the 186 tests on this page, the service was out of CPU in 134, the load generator in 2, PostgreSQL in 0, and nothing in 50 (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.
One row by primary key
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.
- 1Go 1.27 · net/http54,910req/s
- 2Gin 1.12 (Go)54,489req/s
- 3NpgsqlRest 4.1 JIT · SQL files53,981req/s
- 4Bun 1.451,073req/s
- 5NpgsqlRest 3.21 JIT · SQL files50,272req/s
- 6NpgsqlRest 3.21 JIT · functions49,233req/s
- 7NpgsqlRest 4.1 JIT · functions48,985req/s
- 8.NET 10 · plain Npgsql47,370req/s
- 9NpgsqlRest 4.1 AOT · SQL files46,059req/s
- 10Deno 2.946,033req/s
- 11NpgsqlRest 3.21 AOT · SQL files45,694req/s
- 12NpgsqlRest 3.21 AOT · functions45,404req/s
- 13NpgsqlRest 4.1 AOT · functions45,305req/s
- 14.NET 10 · Dapper45,103req/s
- 15.NET 11 · plain Npgsql44,322req/s
- 16.NET 11 · Dapper43,260req/s
- 17Axum 0.8 (Rust)41,821req/s
- 18Actix-web 4.20 (Rust)41,541req/s
- 19Spring Boot 4.2 (Java 25)35,283req/s
- 20Fastify 5.1233,821req/s
- 21Swoole 6.2 (PHP)24,855req/s
- 22Express 5.324,424req/s
- 23NestJS 12.622,433req/s
- 24.NET 10 · EF Core14,102req/s
- 25.NET 11 · EF Core14,039req/s
- 26PostGraphile 5.2 (GraphQL)10,211req/s
- 27FastAPI 0.1659,301req/s
- 28PostgREST 16.67,202req/s
- 29Hasura 2.50 (GraphQL)3,243req/s
- 30Django 6.12,439req/s
- 31Laravel Octane 13.431,878req/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, Go 1.27 · net/http is first with 54,910 requests per second, 0.8% ahead of Gin 1.12 (Go). 5 of the 31 services are within 10% of the leader, and the slowest does 1,878.
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 | Go 1.27 · net/http | 1 | 54,910 | 100% | main.go |
| NpgsqlRest | NpgsqlRest 4.1 JIT · SQL files | 3 | 53,981 | 98% | appsettings.json |
| Bun & Deno | Bun 1.4 | 4 | 51,073 | 93% | app.ts |
| .NET | .NET 10 · plain Npgsql | 8 | 47,370 | 86% | Program.cs |
| Rust | Axum 0.8 (Rust) | 17 | 41,821 | 76% | main.rs |
| Java | Spring Boot 4.2 (Java 25) | 19 | 35,283 | 64% | Application.java |
| Node.js | Fastify 5.12 | 20 | 33,821 | 62% | app.js |
| PHP | Swoole 6.2 (PHP) | 21 | 24,855 | 45% | server.php |
| GraphQL | PostGraphile 5.2 (GraphQL) | 26 | 10,211 | 19% | graphile.config.mjs |
| Python | FastAPI 0.165 | 27 | 9,301 | 17% | app.py |
| PostgREST | PostgREST 16.6 | 28 | 7,202 | 13% | 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 | Go 1.27 · net/http | 54,910 | 0.64 | 2.6 | 3.43 | 16,011 | 33 | 4% | service |
| 2 | Gin 1.12 (Go) | 54,489 | 0.65 | 2.7 | 3.46 | 15,755 | 33 | 4% | service |
| 3 | NpgsqlRest 4.1 JIT · SQL files | 53,981 | 0.67 | 2.7 | 3.37 | 16,039 | 162 | 3% | — |
| 4 | Bun 1.4 | 51,073 | 0.75 | 2.6 | 3.52 | 14,529 | 152 | 4% | service |
| 5 | NpgsqlRest 3.21 JIT · SQL files | 50,272 | 0.74 | 2.6 | 3.57 | 14,079 | 187 | 3% | service |
| 6 | NpgsqlRest 3.21 JIT · functions | 49,233 | 0.69 | 4.3 | 3.75 | 13,112 | 247 | 3% | service |
| 7 | NpgsqlRest 4.1 JIT · functions | 48,985 | 0.70 | 3.6 | 3.12 | 15,722 | 163 | 3% | — |
| 8 | .NET 10 · plain Npgsql | 47,370 | 0.74 | 4.3 | 3.73 | 12,686 | 135 | 2% | service |
| 9 | NpgsqlRest 4.1 AOT · SQL files | 46,059 | 0.81 | 3.2 | 3.38 | 13,622 | 89 | 3% | — |
| 10 | Deno 2.9 | 46,033 | 0.86 | 2.2 | 3.60 | 12,773 | 393 | 3% | service |
| 11 | NpgsqlRest 3.21 AOT · SQL files | 45,694 | 0.84 | 2.6 | 3.50 | 13,051 | 106 | 3% | service |
| 12 | NpgsqlRest 3.21 AOT · functions | 45,404 | 0.85 | 2.5 | 3.60 | 12,622 | 171 | 3% | service |
| 13 | NpgsqlRest 4.1 AOT · functions | 45,305 | 0.83 | 3.0 | 3.44 | 13,175 | 87 | 3% | service |
| 14 | .NET 10 · Dapper | 45,103 | 0.77 | 5.1 | 3.76 | 11,993 | 146 | 2% | service |
| 15 | .NET 11 · plain Npgsql | 44,322 | 0.84 | 3.5 | 3.26 | 13,597 | 152 | 2% | — |
| 16 | .NET 11 · Dapper | 43,260 | 0.88 | 3.4 | 3.31 | 13,066 | 166 | 2% | — |
| 17 | Axum 0.8 (Rust) | 41,821 | 1.00 | 1.9 | 3.52 | 11,889 | 21 | 3% | service |
| 18 | Actix-web 4.20 (Rust) | 41,541 | 0.97 | 1.9 | 3.55 | 11,700 | 82 | 3% | service |
| 19 | Spring Boot 4.2 (Java 25) | 35,283 | 1.02 | 4.0 | 3.72 | 9,477 | 1,593 | 4% | service |
| 20 | Fastify 5.12 | 33,821 | 1.30 | 2.5 | 3.63 | 9,328 | 529 | 2% | service |
| 21 | Swoole 6.2 (PHP) | 24,855 | 1.81 | 2.3 | 3.72 | 6,673 | 140 | 2% | service |
| 22 | Express 5.3 | 24,424 | 1.88 | 3.2 | 3.80 | 6,424 | 640 | 2% | service |
| 23 | NestJS 12.6 | 22,433 | 2.06 | 3.4 | 3.79 | 5,912 | 697 | 2% | service |
| 24 | .NET 10 · EF Core | 14,102 | 3.03 | 5.9 | 3.83 | 3,685 | 216 | 1% | service |
| 25 | .NET 11 · EF Core | 14,039 | 2.49 | 11.1 | 3.64 | 3,853 | 210 | 1% | service |
| 26 | PostGraphile 5.2 (GraphQL) | 10,211 | 3.79 | 11.9 | 3.82 | 2,673 | 1,043 | 1% | service |
| 27 | FastAPI 0.165 | 9,301 | 4.71 | 6.8 | 3.78 | 2,460 | 297 | 0% | service |
| 28 | PostgREST 16.6 | 7,202 | 6.44 | 8.4 | 2.96 | 2,432 | 80 | 1% | — |
| 29 | Hasura 2.50 (GraphQL) | 3,243 | 15.00 | 21.2 | 2.24 | 1,449 | 194 | 0% | — |
| 30 | Django 6.1 | 2,439 | 19.30 | 28.8 | 3.40 | 717 | 481 | 0% | service |
| 31 | Laravel Octane 13.43 | 1,878 | 22.19 | 51.6 | 3.91 | 481 | 921 | 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 | 200 users |
|---|---|---|
| Go 1.27 · net/http | 54,910 | 55,233 |
| Gin 1.12 (Go) | 54,489 | 54,887 |
| NpgsqlRest 4.1 JIT · SQL files | 53,981 | 53,638 |
| Bun 1.4 | 51,073 | 53,815 |
| NpgsqlRest 3.21 JIT · SQL files | 50,272 | 52,392 |
| NpgsqlRest 3.21 JIT · functions | 49,233 | 52,817 |
| NpgsqlRest 4.1 JIT · functions | 48,985 | 53,704 |
| .NET 10 · plain Npgsql | 47,370 | 52,946 |
| NpgsqlRest 4.1 AOT · SQL files | 46,059 | 46,906 |
| Deno 2.9 | 46,033 | 54,357 |
| NpgsqlRest 3.21 AOT · SQL files | 45,694 | 48,650 |
| NpgsqlRest 3.21 AOT · functions | 45,404 | 47,710 |
| NpgsqlRest 4.1 AOT · functions | 45,305 | 46,489 |
| .NET 10 · Dapper | 45,103 | 49,866 |
| .NET 11 · plain Npgsql | 44,322 | 46,823 |
| .NET 11 · Dapper | 43,260 | 44,198 |
| Axum 0.8 (Rust) | 41,821 | 48,503 |
| Actix-web 4.20 (Rust) | 41,541 | 46,740 |
| Spring Boot 4.2 (Java 25) | 35,283 | 33,999 |
| Fastify 5.12 | 33,821 | 35,875 |
| Swoole 6.2 (PHP) | 24,855 | 25,354 |
| Express 5.3 | 24,424 | 25,775 |
| NestJS 12.6 | 22,433 | 23,944 |
| .NET 10 · EF Core | 14,102 | 14,801 |
| .NET 11 · EF Core | 14,039 | 15,028 |
| PostGraphile 5.2 (GraphQL) | 10,211 | 9,762 |
| FastAPI 0.165 | 9,301 | 9,781 |
| PostgREST 16.6 | 7,202 | 6,531 |
| Hasura 2.50 (GraphQL) | 3,243 | 3,051 |
| Django 6.1 | 2,439 | 2,344 |
| Laravel Octane 13.43 | 1,878 | 1,904 |
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.
One page of a list (20 rows)
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.
- 1NpgsqlRest 4.1 JIT · SQL files38,217req/s
- 2NpgsqlRest 4.1 JIT · functions37,779req/s
- 3.NET 10 · plain Npgsql36,363req/s
- 4.NET 10 · Dapper34,617req/s
- 5NpgsqlRest 3.21 JIT · SQL files32,998req/s
- 6.NET 11 · plain Npgsql32,947req/s
- 7NpgsqlRest 3.21 JIT · functions32,672req/s
- 8NpgsqlRest 4.1 AOT · SQL files31,978req/s
- 9NpgsqlRest 4.1 AOT · functions31,911req/s
- 10Axum 0.8 (Rust)31,642req/s
- 11Actix-web 4.20 (Rust)31,039req/s
- 12NpgsqlRest 3.21 AOT · functions30,947req/s
- 13.NET 11 · Dapper30,672req/s
- 14NpgsqlRest 3.21 AOT · SQL files30,461req/s
- 15Bun 1.430,247req/s
- 16Gin 1.12 (Go)29,924req/s
- 17Go 1.27 · net/http29,588req/s
- 18Deno 2.925,768req/s
- 19Spring Boot 4.2 (Java 25)23,332req/s
- 20Swoole 6.2 (PHP)19,391req/s
- 21Fastify 5.1218,284req/s
- 22Express 5.315,013req/s
- 23NestJS 12.614,199req/s
- 24.NET 11 · EF Core12,987req/s
- 25.NET 10 · EF Core12,898req/s
- 26PostGraphile 5.2 (GraphQL)6,559req/s
- 27PostgREST 16.66,290req/s
- 28FastAPI 0.1654,418req/s
- 29Hasura 2.50 (GraphQL)3,147req/s
- 30Django 6.12,200req/s
- 31Laravel Octane 13.431,782req/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, NpgsqlRest 4.1 JIT · SQL files is first with 38,217 requests per second, 1.2% ahead of NpgsqlRest 4.1 JIT · functions. 4 of the 31 services are within 10% of the leader, and the slowest does 1,782.
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 |
|---|---|---|---|---|---|
| NpgsqlRest | NpgsqlRest 4.1 JIT · SQL files | 1 | 38,217 | 100% | appsettings.json |
| .NET | .NET 10 · plain Npgsql | 3 | 36,363 | 95% | Program.cs |
| Rust | Axum 0.8 (Rust) | 10 | 31,642 | 83% | main.rs |
| Bun & Deno | Bun 1.4 | 15 | 30,247 | 79% | app.ts |
| Go | Gin 1.12 (Go) | 16 | 29,924 | 78% | main.go |
| Java | Spring Boot 4.2 (Java 25) | 19 | 23,332 | 61% | Application.java |
| PHP | Swoole 6.2 (PHP) | 20 | 19,391 | 51% | server.php |
| Node.js | Fastify 5.12 | 21 | 18,284 | 48% | app.js |
| GraphQL | PostGraphile 5.2 (GraphQL) | 26 | 6,559 | 17% | graphile.config.mjs |
| PostgREST | PostgREST 16.6 | 27 | 6,290 | 16% | postgrest.conf |
| Python | FastAPI 0.165 | 28 | 4,418 | 12% | app.py |
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 | NpgsqlRest 4.1 JIT · SQL files | 38,217 | 0.88 | 3.7 | 3.25 | 11,765 | 166 | 5% | — |
| 2 | NpgsqlRest 4.1 JIT · functions | 37,779 | 0.90 | 3.7 | 3.23 | 11,698 | 152 | 5% | — |
| 3 | .NET 10 · plain Npgsql | 36,363 | 0.90 | 4.2 | 3.67 | 9,903 | 137 | 3% | service |
| 4 | .NET 10 · Dapper | 34,617 | 1.02 | 3.8 | 3.55 | 9,762 | 154 | 2% | service |
| 5 | NpgsqlRest 3.21 JIT · SQL files | 32,998 | 1.11 | 3.4 | 3.70 | 8,913 | 208 | 4% | service |
| 6 | .NET 11 · plain Npgsql | 32,947 | 1.00 | 4.9 | 3.16 | 10,424 | 164 | 2% | — |
| 7 | NpgsqlRest 3.21 JIT · functions | 32,672 | 1.12 | 3.4 | 3.66 | 8,916 | 261 | 5% | service |
| 8 | NpgsqlRest 4.1 AOT · SQL files | 31,978 | 1.15 | 4.0 | 3.42 | 9,353 | 90 | 4% | service |
| 9 | NpgsqlRest 4.1 AOT · functions | 31,911 | 1.16 | 3.9 | 3.44 | 9,284 | 88 | 4% | service |
| 10 | Axum 0.8 (Rust) | 31,642 | 1.25 | 3.0 | 3.55 | 8,907 | 20 | 5% | service |
| 11 | Actix-web 4.20 (Rust) | 31,039 | 1.26 | 3.0 | 3.42 | 9,086 | 82 | 5% | service |
| 12 | NpgsqlRest 3.21 AOT · functions | 30,947 | 1.21 | 3.3 | 3.54 | 8,734 | 121 | 4% | service |
| 13 | .NET 11 · Dapper | 30,672 | 1.08 | 5.5 | 3.22 | 9,522 | 175 | 2% | — |
| 14 | NpgsqlRest 3.21 AOT · SQL files | 30,461 | 1.15 | 4.9 | 3.71 | 8,209 | 104 | 4% | service |
| 15 | Bun 1.4 | 30,247 | 1.17 | 4.0 | 3.64 | 8,317 | 159 | 5% | service |
| 16 | Gin 1.12 (Go) | 29,924 | 1.15 | 4.6 | 3.50 | 8,539 | 35 | 6% | service |
| 17 | Go 1.27 · net/http | 29,588 | 1.17 | 4.5 | 3.52 | 8,418 | 34 | 7% | service |
| 18 | Deno 2.9 | 25,768 | 1.54 | 3.4 | 3.73 | 6,907 | 392 | 4% | service |
| 19 | Spring Boot 4.2 (Java 25) | 23,332 | 1.64 | 5.0 | 3.76 | 6,206 | 1,603 | 5% | service |
| 20 | Swoole 6.2 (PHP) | 19,391 | 2.35 | 3.2 | 3.74 | 5,186 | 139 | 3% | service |
| 21 | Fastify 5.12 | 18,284 | 2.43 | 3.7 | 3.77 | 4,854 | 542 | 3% | service |
| 22 | Express 5.3 | 15,013 | 3.00 | 4.5 | 3.75 | 3,999 | 631 | 2% | service |
| 23 | NestJS 12.6 | 14,199 | 3.19 | 4.8 | 3.76 | 3,780 | 690 | 3% | service |
| 24 | .NET 11 · EF Core | 12,987 | 3.20 | 7.0 | 3.71 | 3,503 | 204 | 1% | service |
| 25 | .NET 10 · EF Core | 12,898 | 3.33 | 5.9 | 3.84 | 3,362 | 217 | 1% | service |
| 26 | PostGraphile 5.2 (GraphQL) | 6,559 | 5.27 | 28.5 | 3.76 | 1,742 | 971 | 3% | service |
| 27 | PostgREST 16.6 | 6,290 | 7.36 | 9.4 | 2.92 | 2,152 | 79 | 2% | — |
| 28 | FastAPI 0.165 | 4,418 | 10.05 | 14.1 | 3.81 | 1,161 | 214 | 0% | service |
| 29 | Hasura 2.50 (GraphQL) | 3,147 | 15.62 | 22.0 | 2.28 | 1,382 | 206 | 1% | — |
| 30 | Django 6.1 | 2,200 | 21.15 | 34.3 | 3.50 | 629 | 279 | 1% | service |
| 31 | Laravel Octane 13.43 | 1,782 | 23.63 | 54.7 | 3.92 | 455 | 951 | 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 | 200 users |
|---|---|---|
| NpgsqlRest 4.1 JIT · SQL files | 38,217 | 37,792ᵏ |
| NpgsqlRest 4.1 JIT · functions | 37,779 | 37,877ᵏ |
| .NET 10 · plain Npgsql | 36,363 | 37,599 |
| .NET 10 · Dapper | 34,617 | 34,485 |
| NpgsqlRest 3.21 JIT · SQL files | 32,998 | 33,523 |
| .NET 11 · plain Npgsql | 32,947 | 35,014 |
| NpgsqlRest 3.21 JIT · functions | 32,672 | 33,254 |
| NpgsqlRest 4.1 AOT · SQL files | 31,978 | 31,788 |
| NpgsqlRest 4.1 AOT · functions | 31,911 | 32,363 |
| Axum 0.8 (Rust) | 31,642 | 35,358 |
| Actix-web 4.20 (Rust) | 31,039 | 35,325 |
| NpgsqlRest 3.21 AOT · functions | 30,947 | 32,206 |
| .NET 11 · Dapper | 30,672 | 33,111 |
| NpgsqlRest 3.21 AOT · SQL files | 30,461 | 32,689 |
| Bun 1.4 | 30,247 | 31,730 |
| Gin 1.12 (Go) | 29,924 | 31,187 |
| Go 1.27 · net/http | 29,588 | 31,243 |
| Deno 2.9 | 25,768 | 28,718 |
| Spring Boot 4.2 (Java 25) | 23,332 | 22,467 |
| Swoole 6.2 (PHP) | 19,391 | 19,600 |
| Fastify 5.12 | 18,284 | 18,751 |
| Express 5.3 | 15,013 | 15,464 |
| NestJS 12.6 | 14,199 | 14,959 |
| .NET 11 · EF Core | 12,987 | 13,428 |
| .NET 10 · EF Core | 12,898 | 13,019 |
| PostGraphile 5.2 (GraphQL) | 6,559 | 6,570 |
| PostgREST 16.6 | 6,290 | 5,659 |
| FastAPI 0.165 | 4,418 | 4,542 |
| Hasura 2.50 (GraphQL) | 3,147 | 2,871 |
| Django 6.1 | 2,200 | 2,128 |
| Laravel Octane 13.43 | 1,782 | 1,790 |
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.
An insert that returns the row
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.
- 1Bun 1.434,440req/s
- 2Go 1.27 · net/http33,651req/s
- 3Axum 0.8 (Rust)32,789req/s
- 4Deno 2.932,349req/s
- 5NpgsqlRest 3.21 JIT · functions32,058req/s
- 6Actix-web 4.20 (Rust)31,955req/s
- 7NpgsqlRest 3.21 JIT · SQL files31,854req/s
- 8Gin 1.12 (Go)31,511req/s
- 9NpgsqlRest 4.1 JIT · SQL files30,878req/s
- 10NpgsqlRest 3.21 AOT · SQL files30,393req/s
- 11NpgsqlRest 3.21 AOT · functions30,288req/s
- 12NpgsqlRest 4.1 JIT · functions29,919req/s
- 13.NET 11 · Dapper29,424req/s
- 14.NET 10 · Dapper28,329req/s
- 15.NET 11 · plain Npgsql27,970req/s
- 16.NET 10 · plain Npgsql27,501req/s
- 17NpgsqlRest 4.1 AOT · SQL files27,403req/s
- 18NpgsqlRest 4.1 AOT · functions26,984req/s
- 19Fastify 5.1226,707req/s
- 20Spring Boot 4.2 (Java 25)25,583req/s
- 21Swoole 6.2 (PHP)22,859req/s
- 22Express 5.319,542req/s
- 23NestJS 12.617,964req/s
- 24.NET 11 · EF Core13,382req/s
- 25.NET 10 · EF Core12,848req/s
- 26FastAPI 0.1658,646req/s
- 27PostGraphile 5.2 (GraphQL)7,429req/s
- 28PostgREST 16.66,400req/s
- 29Hasura 2.50 (GraphQL)2,535req/s
- 30Django 6.12,442req/s
- 31Laravel Octane 13.431,848req/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, Bun 1.4 is first with 34,440 requests per second, 2.3% ahead of Go 1.27 · net/http. 8 of the 31 services are within 10% of the leader, and the slowest does 1,848.
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 |
|---|---|---|---|---|---|
| Bun & Deno | Bun 1.4 | 1 | 34,440 | 100% | app.ts |
| Go | Go 1.27 · net/http | 2 | 33,651 | 98% | main.go |
| Rust | Axum 0.8 (Rust) | 3 | 32,789 | 95% | main.rs |
| NpgsqlRest | NpgsqlRest 3.21 JIT · functions | 5 | 32,058 | 93% | appsettings.json |
| .NET | .NET 11 · Dapper | 13 | 29,424 | 85% | Program.cs |
| Node.js | Fastify 5.12 | 19 | 26,707 | 78% | app.js |
| Java | Spring Boot 4.2 (Java 25) | 20 | 25,583 | 74% | Application.java |
| PHP | Swoole 6.2 (PHP) | 21 | 22,859 | 66% | server.php |
| Python | FastAPI 0.165 | 26 | 8,646 | 25% | app.py |
| GraphQL | PostGraphile 5.2 (GraphQL) | 27 | 7,429 | 22% | graphile.config.mjs |
| PostgREST | PostgREST 16.6 | 28 | 6,400 | 19% | 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 | Bun 1.4 | 34,440 | 1.14 | 2.8 | 2.87 | 12,013 | 155 | 3% | — |
| 2 | Go 1.27 · net/http | 33,651 | 1.17 | 2.8 | 2.66 | 12,633 | 32 | 3% | — |
| 3 | Axum 0.8 (Rust) | 32,789 | 1.24 | 2.4 | 3.02 | 10,870 | 23 | 3% | — |
| 4 | Deno 2.9 | 32,349 | 1.26 | 2.5 | 2.92 | 11,063 | 391 | 3% | — |
| 5 | NpgsqlRest 3.21 JIT · functions | 32,058 | 1.22 | 2.7 | 3.19 | 10,050 | 252 | 3% | — |
| 6 | Actix-web 4.20 (Rust) | 31,955 | 1.28 | 2.3 | 3.09 | 10,328 | 32 | 3% | — |
| 7 | NpgsqlRest 3.21 JIT · SQL files | 31,854 | 1.22 | 2.7 | 3.14 | 10,158 | 175 | 1% | — |
| 8 | Gin 1.12 (Go) | 31,511 | 1.29 | 2.8 | 2.59 | 12,149 | 32 | 3% | — |
| 9 | NpgsqlRest 4.1 JIT · SQL files | 30,878 | 1.24 | 3.2 | 2.50 | 12,355 | 154 | 1% | — |
| 10 | NpgsqlRest 3.21 AOT · SQL files | 30,393 | 1.28 | 2.9 | 3.13 | 9,726 | 104 | 1% | — |
| 11 | NpgsqlRest 3.21 AOT · functions | 30,288 | 1.29 | 2.9 | 3.15 | 9,626 | 114 | 3% | — |
| 12 | NpgsqlRest 4.1 JIT · functions | 29,919 | 1.33 | 2.9 | 2.55 | 11,731 | 157 | 3% | — |
| 13 | .NET 11 · Dapper | 29,424 | 1.37 | 3.0 | 2.85 | 10,318 | 143 | 4% | — |
| 14 | .NET 10 · Dapper | 28,329 | 1.43 | 3.0 | 3.19 | 8,874 | 150 | 4% | — |
| 15 | .NET 11 · plain Npgsql | 27,970 | 1.42 | 3.3 | 2.65 | 10,570 | 153 | 3% | — |
| 16 | .NET 10 · plain Npgsql | 27,501 | 1.47 | 3.1 | 3.04 | 9,033 | 135 | 4% | — |
| 17 | NpgsqlRest 4.1 AOT · SQL files | 27,403 | 1.45 | 3.2 | 2.61 | 10,505 | 91 | 1% | — |
| 18 | NpgsqlRest 4.1 AOT · functions | 26,984 | 1.51 | 3.1 | 2.78 | 9,701 | 91 | 3% | — |
| 19 | Fastify 5.12 | 26,707 | 1.56 | 3.1 | 3.46 | 7,727 | 543 | 2% | service |
| 20 | Spring Boot 4.2 (Java 25) | 25,583 | 1.66 | 2.8 | 3.19 | 8,009 | 1,613 | 3% | — |
| 21 | Swoole 6.2 (PHP) | 22,859 | 1.79 | 2.9 | 3.60 | 6,347 | 142 | 2% | service |
| 22 | Express 5.3 | 19,542 | 2.24 | 4.2 | 3.66 | 5,337 | 640 | 2% | service |
| 23 | NestJS 12.6 | 17,964 | 2.41 | 4.4 | 3.61 | 4,973 | 700 | 2% | service |
| 24 | .NET 11 · EF Core | 13,382 | 3.04 | 6.5 | 3.64 | 3,672 | 217 | 3% | service |
| 25 | .NET 10 · EF Core | 12,848 | 2.91 | 11.8 | 3.78 | 3,399 | 231 | 3% | service |
| 26 | FastAPI 0.165 | 8,646 | 5.04 | 8.0 | 3.71 | 2,330 | 297 | 0% | service |
| 27 | PostGraphile 5.2 (GraphQL) | 7,429 | 5.29 | 18.0 | 3.68 | 2,021 | 940 | 1% | service |
| 28 | PostgREST 16.6 | 6,400 | 7.14 | 13.3 | 2.88 | 2,223 | 84 | 1% | — |
| 29 | Hasura 2.50 (GraphQL) | 2,535 | 19.11 | 25.6 | 2.57 | 985 | 199 | 0% | — |
| 30 | Django 6.1 | 2,442 | 18.98 | 33.2 | 3.46 | 706 | 506 | 0% | service |
| 31 | Laravel Octane 13.43 | 1,848 | 23.04 | 52.5 | 3.86 | 478 | 977 | 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 | 200 users |
|---|---|---|
| Bun 1.4 | 34,440 | 47,482 |
| Go 1.27 · net/http | 33,651 | 49,725 |
| Axum 0.8 (Rust) | 32,789 | 45,961 |
| Deno 2.9 | 32,349 | 48,030 |
| NpgsqlRest 3.21 JIT · functions | 32,058 | 45,908 |
| Actix-web 4.20 (Rust) | 31,955 | 43,303 |
| NpgsqlRest 3.21 JIT · SQL files | 31,854 | 44,754 |
| Gin 1.12 (Go) | 31,511 | 48,623 |
| NpgsqlRest 4.1 JIT · SQL files | 30,878 | 45,434 |
| NpgsqlRest 3.21 AOT · SQL files | 30,393 | 41,345 |
| NpgsqlRest 3.21 AOT · functions | 30,288 | 41,679 |
| NpgsqlRest 4.1 JIT · functions | 29,919 | 46,159 |
| .NET 11 · Dapper | 29,424 | 36,639 |
| .NET 10 · Dapper | 28,329 | 38,281 |
| .NET 11 · plain Npgsql | 27,970 | 36,384 |
| .NET 10 · plain Npgsql | 27,501 | 38,220 |
| NpgsqlRest 4.1 AOT · SQL files | 27,403 | 40,095 |
| NpgsqlRest 4.1 AOT · functions | 26,984 | 40,609 |
| Fastify 5.12 | 26,707 | 30,099 |
| Spring Boot 4.2 (Java 25) | 25,583 | 28,235 |
| Swoole 6.2 (PHP) | 22,859 | 24,308 |
| Express 5.3 | 19,542 | 21,672 |
| NestJS 12.6 | 17,964 | 20,674 |
| .NET 11 · EF Core | 13,382 | 14,421 |
| .NET 10 · EF Core | 12,848 | 14,159 |
| FastAPI 0.165 | 8,646 | 9,630 |
| PostGraphile 5.2 (GraphQL) | 7,429 | 7,891 |
| PostgREST 16.6 | 6,400 | 5,789 |
| Hasura 2.50 (GraphQL) | 2,535 | 2,343 |
| Django 6.1 | 2,442 | 2,321 |
| Laravel Octane 13.43 | 1,848 | 1,861 |
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: ← Many Parameters · Next: Resources →