Skip to content

Overall Results: 31 Services, 44 Tests Each ​

Benchmark · November 2026 · Overall Results

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:

The short version ​

  • Go is the fastest. Gin 1.12 (Go) and Go 1.27 · net/http reach 93% and 91% of the best possible score, and one of the two was the fastest service in 17 of the 44 tests.
  • Behind Go there is a close group of 17 services between 71% and 84%: Bun, Deno, NpgsqlRest, the two Rust services, Swoole, and .NET with plain Npgsql or Dapper.
  • NpgsqlRest 4.1 is in that group with no endpoint code written. Its four variants score 75% to 82% (positions 4, 6, 9, 14 of 31). The API is generated from PostgreSQL functions or SQL files.
  • The three other generated APIs are far behind: PostgREST 33%, Hasura 26%, PostGraphile 20%.
  • Laravel Octane and Django are last (20% and 17%), with FastAPI at 29%.
  • No test failed. In none of the 1,364 tests did more than 1% of the requests fail.

The leaderboard ​

How the score works

Every service ran the same 44 tests. In each test, the service that answered the most requests per second gets 100%, and every other service gets its own requests per second as a percentage of that. A service half as fast as the winner of a test gets 50% for that test.

The score is the average of a service's 44 percentages. A service that was the fastest in every single test would score 100%.

Example: NpgsqlRest 4.1 JIT · SQL files scores 82%. Averaged over all 44 tests, it answered 82 requests for every 100 that the fastest service of each test answered.

Speed score: how fast each service is, compared with the fastest (average of 44 tests)

↑ longer bar is better100% would mean: the fastest service in every test. 50% means: on average, half as fast as the fastest.

  1. 1Gin 1.12 (Go)93%
  2. 2Go 1.27 · net/http91%
  3. 3Bun 1.484%
  4. 4NpgsqlRest 4.1 JIT · SQL files82%
  5. 5Deno 2.982%
  6. 6NpgsqlRest 4.1 JIT · functions79%
  7. 7NpgsqlRest 3.21 JIT · SQL files77%
  8. 8.NET 10 · plain Npgsql77%
  9. 9NpgsqlRest 4.1 AOT · SQL files77%
  10. 10Axum 0.8 (Rust)76%
  11. 11.NET 10 · Dapper76%
  12. 12Actix-web 4.20 (Rust)76%
  13. 13.NET 11 · plain Npgsql75%
  14. 14NpgsqlRest 4.1 AOT · functions75%
  15. 15NpgsqlRest 3.21 JIT · functions75%
  16. 16.NET 11 · Dapper74%
  17. 17NpgsqlRest 3.21 AOT · SQL files73%
  18. 18Swoole 6.2 (PHP)73%
  19. 19NpgsqlRest 3.21 AOT · functions71%
  20. 20Fastify 5.1267%
  21. 21Spring Boot 4.2 (Java 25)61%
  22. 22NestJS 12.656%
  23. 23Express 5.356%
  24. 24.NET 11 · EF Core50%
  25. 25.NET 10 · EF Core49%
  26. 26PostgREST 16.633%
  27. 27FastAPI 0.16529%
  28. 28Hasura 2.50 (GraphQL)26%
  29. 29PostGraphile 5.2 (GraphQL)20%
  30. 30Laravel Octane 13.4320%
  31. 31Django 6.117%

The score shows how far apart services are, which a plain ranking hides: positions 3 to 19 are all within 13 percentage points of each other. In many tests the tool that sends the requests ran out of CPU before the fastest services did (see what limited the tests), which pulls the fast services closer together than they really are.

How often each service was the fastest ​

For each of the 44 tests, the 31 services are put in order by requests per second. This table counts how often each service finished first, second or third.

How to read a row: Go 1.27 · net/http was the fastest of all 31 services in 14 of the 44 tests, the second fastest in 9, and the third fastest in 7. So it was among the three fastest in 30 of 44 tests.

ServiceWas the fastest in … testsWas second in … testsWas third in … testsAmong the three fastest
Go 1.27 · net/http149730 of 44
Swoole 6.2 (PHP)80513 of 44
NpgsqlRest 4.1 JIT · SQL files66214 of 44
Bun 1.453412 of 44
Gin 1.12 (Go)317727 of 44
NpgsqlRest 3.21 JIT · SQL files3025 of 44
Deno 2.92327 of 44
FastAPI 0.1652002 of 44
NpgsqlRest 4.1 JIT · functions1146 of 44
NpgsqlRest 4.1 AOT · SQL files0224 of 44
Axum 0.8 (Rust)0123 of 44
NpgsqlRest 3.21 AOT · SQL files0123 of 44
Fastify 5.120112 of 44
.NET 10 · plain Npgsql0033 of 44
Actix-web 4.20 (Rust)0011 of 44

Services that are not listed were never among the three fastest. Swoole's 8 first places are all in the data types tests, most of them with 100 or 500 rows, where the load generator is the limit; that page explains why those say little.

Two services were corrected and run again

In the first run, PostgREST and Swoole were held back by how they were set up in this benchmark, not by what they can do: PostgREST had 10 database connections where the others had 100, and the Swoole service answered only four requests at a time. Both were corrected and all their tests were run again on a second server of the same type. The numbers on these pages are the corrected ones. What happened, and how the two runs were checked against each other.

The best of each platform ​

For each platform, its service with the highest speed score, and where its other services are.

PlatformIts fastest servicePositionSpeed scoreIts other services (position)
GoGin 1.12 (Go)1 of 3193%Go 1.27 · net/http (2)
Bun & DenoBun 1.43 of 3184%Deno 2.9 (5)
NpgsqlRestNpgsqlRest 4.1 JIT · SQL files4 of 3182%NpgsqlRest 4.1 JIT · functions (6), NpgsqlRest 3.21 JIT · SQL files (7), NpgsqlRest 4.1 AOT · SQL files (9), NpgsqlRest 4.1 AOT · functions (14), NpgsqlRest 3.21 JIT · functions (15), NpgsqlRest 3.21 AOT · SQL files (17), NpgsqlRest 3.21 AOT · functions (19)
.NET.NET 10 · plain Npgsql8 of 3177%.NET 10 · Dapper (11), .NET 11 · plain Npgsql (13), .NET 11 · Dapper (16), .NET 11 · EF Core (24), .NET 10 · EF Core (25)
RustAxum 0.8 (Rust)10 of 3176%Actix-web 4.20 (Rust) (12)
PHPSwoole 6.2 (PHP)18 of 3173%Laravel Octane 13.43 (30)
Node.jsFastify 5.1220 of 3167%NestJS 12.6 (22), Express 5.3 (23)
JavaSpring Boot 4.2 (Java 25)21 of 3161%—
PostgRESTPostgREST 16.626 of 3133%—
PythonFastAPI 0.16527 of 3129%Django 6.1 (31)
GraphQLHasura 2.50 (GraphQL)28 of 3126%PostGraphile 5.2 (GraphQL) (29)

Every service, with its position in each kind of test, is in Every Service, One Scorecard.

Who is first, by kind of test ​

Kind of testIts main testFastestRequests/sSecondThirdFastest generated API (its place)
Data types100 users, 10 rowsNpgsqlRest 4.1 JIT · SQL files16,948Gin 1.12 (Go)NpgsqlRest 4.1 JIT · functionsNpgsqlRest 4.1 JIT · SQL files (1)
Minimal request100 usersGo 1.27 · net/http61,391Gin 1.12 (Go)Bun 1.4NpgsqlRest 3.21 JIT · SQL files (4)
POST body50 users, 10 rowsGo 1.27 · net/http39,402Bun 1.4Gin 1.12 (Go)NpgsqlRest 4.1 JIT · SQL files (6)
Nested JSON50 users, depth 1Go 1.27 · net/http20,264Gin 1.12 (Go)Axum 0.8 (Rust)NpgsqlRest 4.1 JIT · SQL files (6)
Large payload25 users, 100 KBNpgsqlRest 4.1 JIT · SQL files8,786NpgsqlRest 4.1 AOT · SQL filesFastify 5.12NpgsqlRest 4.1 JIT · SQL files (1)
Many parameters50 usersGin 1.12 (Go)50,908Go 1.27 · net/httpBun 1.4NpgsqlRest 4.1 JIT · SQL files (5)
Table lookup50 usersGo 1.27 · net/http54,910Gin 1.12 (Go)NpgsqlRest 4.1 JIT · SQL filesNpgsqlRest 4.1 JIT · SQL files (3)
Table list page50 usersNpgsqlRest 4.1 JIT · SQL files38,217NpgsqlRest 4.1 JIT · functions.NET 10 · plain NpgsqlNpgsqlRest 4.1 JIT · SQL files (1)
Table insert50 usersBun 1.434,440Go 1.27 · net/httpAxum 0.8 (Rust)NpgsqlRest 3.21 JIT · functions (5)

"Generated API" is a service where no endpoint code is written: NpgsqlRest, PostgREST, Hasura and PostGraphile.

What limited the tests ​

CPU was measured every second for the service, for PostgreSQL and for the load generator, each on its own cores (4, 16 and 12). A part is counted as "out of CPU" in a test when its average was at least 85% of what it may use.

A throughput number is a statement about a service only when the service was the part that ran out. Where the load generator ran out first, the number is a floor: the service could have done more. The charts in this series mark those results.

Kind of testTestsService out of CPULoad generatorPostgreSQLNothing
Data types49613117041154
Minimal request93650028
POST body1868188017
Nested JSON18639120027
Large payload1242401486
Many parameters9384009
Table lookup62500012
Table list page6251209
Table insert62330029
All1,36455838055371

In the previous round (July 2026, on 8 cores) the service was the part out of CPU in 18 of 760 tests. Giving PostgreSQL and the load generator far more cores than the service raised that to 558 of 1,364. The load generator is still the limit in 27% of the tests, mostly where responses are large to parse (data types with 100 and 500 rows, nested JSON, POST body).

Efficiency: requests per CPU core ​

Throughput divided by the CPU the service actually used, averaged over all tests. It is not capped by the load generator the way throughput is: a service that is held back uses less CPU too. This is the cost of a request, and for a hosted service, the size of the bill.

Requests per second for each CPU core the service used (average of all tests)

↑ longer bar is betterHow much work a service gets out of one CPU core. A service with twice the number needs half the processor for the same traffic.

  1. 1NpgsqlRest 4.1 JIT · SQL files4,131req/s per core
  2. 2NpgsqlRest 4.1 JIT · functions4,079req/s per core
  3. 3Actix-web 4.20 (Rust)3,949req/s per core
  4. 4Axum 0.8 (Rust)3,861req/s per core
  5. 5Gin 1.12 (Go)3,846req/s per core
  6. 6Go 1.27 · net/http3,674req/s per core
  7. 7Bun 1.43,630req/s per core
  8. 8.NET 11 · plain Npgsql3,569req/s per core
  9. 9NpgsqlRest 4.1 AOT · SQL files3,557req/s per core
  10. 10Deno 2.93,549req/s per core
  11. 11NpgsqlRest 4.1 AOT · functions3,539req/s per core
  12. 12.NET 11 · Dapper3,474req/s per core
  13. 13.NET 10 · plain Npgsql2,960req/s per core
  14. 14.NET 10 · Dapper2,876req/s per core
  15. 15Swoole 6.2 (PHP)2,861req/s per core
  16. 16NpgsqlRest 3.21 AOT · SQL files2,842req/s per core
  17. 17NpgsqlRest 3.21 JIT · SQL files2,829req/s per core
  18. 18NpgsqlRest 3.21 AOT · functions2,828req/s per core
  19. 19NpgsqlRest 3.21 JIT · functions2,779req/s per core
  20. 20Fastify 5.122,612req/s per core
  21. 21Spring Boot 4.2 (Java 25)2,470req/s per core
  22. 22NestJS 12.62,008req/s per core
  23. 23Express 5.32,005req/s per core
  24. 24.NET 11 · EF Core1,758req/s per core
  25. 25.NET 10 · EF Core1,604req/s per core
  26. 26PostgREST 16.61,508req/s per core
  27. 27Hasura 2.50 (GraphQL)942req/s per core
  28. 28PostGraphile 5.2 (GraphQL)832req/s per core
  29. 29FastAPI 0.165783req/s per core
  30. 30Django 6.1432req/s per core
  31. 31Laravel Octane 13.43366req/s per core

Memory ​

The highest memory of each service container in any of its 44 tests. Lower is better.

The most memory each service used in any test

↓ shorter bar is betterMegabytes of memory at the worst moment of all 44 tests.

  1. 1Go 1.27 · net/http80MB
  2. 2Gin 1.12 (Go)98MB
  3. 3NpgsqlRest 4.1 AOT · functions133MB
  4. 4Axum 0.8 (Rust)133MB
  5. 5Actix-web 4.20 (Rust)137MB
  6. 6PostgREST 16.6142MB
  7. 7Swoole 6.2 (PHP)146MB
  8. 8NpgsqlRest 4.1 AOT · SQL files190MB
  9. 9NpgsqlRest 4.1 JIT · functions205MB
  10. 10NpgsqlRest 4.1 JIT · SQL files224MB
  11. 11.NET 10 · Dapper289MB
  12. 12Bun 1.4292MB
  13. 13FastAPI 0.165303MB
  14. 14.NET 10 · EF Core312MB
  15. 15.NET 10 · plain Npgsql317MB
  16. 16.NET 11 · Dapper319MB
  17. 17.NET 11 · plain Npgsql341MB
  18. 18.NET 11 · EF Core348MB
  19. 19NpgsqlRest 3.21 AOT · functions365MB
  20. 20NpgsqlRest 3.21 JIT · functions422MB
  21. 21NpgsqlRest 3.21 AOT · SQL files436MB
  22. 22NpgsqlRest 3.21 JIT · SQL files542MB
  23. 23Deno 2.9553MB
  24. 24Express 5.3746MB
  25. 25Django 6.1769MB
  26. 26Fastify 5.12774MB
  27. 27NestJS 12.6810MB
  28. 28Laravel Octane 13.43977MB
  29. 29PostGraphile 5.2 (GraphQL)1,309MB
  30. 30Spring Boot 4.2 (Java 25)1,620MB
  31. 31Hasura 2.50 (GraphQL)2,571MB

Memory per kind of test, idle memory, startup time and image size are on the Resources page.

Code you write ​

Speed is one cost of an API; the code somebody has to write, review and keep working is another. This counts the non-blank lines a person wrote for the nine endpoints of each service: its own code and configuration, plus the SQL it needs. For most services the SQL is the 205 lines of PostgreSQL functions that everyone calls. The NpgsqlRest SQL file services need no functions: their endpoints are 135 lines of plain .sql files. Dockerfiles, package manifests and the table definitions are not counted; they are the same kind of thing for all.

Lines somebody had to write for the nine endpoints

↓ shorter bar is betterThe service's own code and configuration plus the SQL it needs, in non-blank lines.

  1. 1NpgsqlRest 4.1 AOT · SQL files164lines
  2. 2NpgsqlRest 4.1 JIT · SQL files164lines
  3. 3NpgsqlRest 3.21 AOT · SQL files164lines
  4. 4NpgsqlRest 3.21 JIT · SQL files164lines
  5. 5PostgREST 16.6221lines
  6. 6NpgsqlRest 4.1 AOT · functions226lines
  7. 7NpgsqlRest 4.1 JIT · functions226lines
  8. 8NpgsqlRest 3.21 AOT · functions226lines
  9. 9NpgsqlRest 3.21 JIT · functions226lines
  10. 10PostGraphile 5.2 (GraphQL)249lines
  11. 11Laravel Octane 13.43304lines
  12. 12.NET 11 · EF Core321lines
  13. 13.NET 10 · EF Core321lines
  14. 14Fastify 5.12334lines
  15. 15Express 5.3335lines
  16. 16NestJS 12.6340lines
  17. 17FastAPI 0.165357lines
  18. 18.NET 11 · Dapper360lines
  19. 19.NET 10 · Dapper360lines
  20. 20Hasura 2.50 (GraphQL)363lines
  21. 21Bun 1.4378lines
  22. 22Deno 2.9381lines
  23. 23Spring Boot 4.2 (Java 25)394lines
  24. 24Django 6.1457lines
  25. 25.NET 11 · plain Npgsql486lines
  26. 26.NET 10 · plain Npgsql486lines
  27. 27Swoole 6.2 (PHP)500lines
  28. 28Axum 0.8 (Rust)539lines
  29. 29Actix-web 4.20 (Rust)550lines
  30. 30Gin 1.12 (Go)573lines
  31. 31Go 1.27 · net/http613lines
The count for every service, with its position in the leaderboard
ServiceOwn code and configurationSQLTotalPosition of 31Its code
NpgsqlRest 4.1 AOT · SQL files29135 (SQL files)1649appsettings.json
NpgsqlRest 4.1 JIT · SQL files29135 (SQL files)1644appsettings.json
NpgsqlRest 3.21 AOT · SQL files29135 (SQL files)16417appsettings.json
NpgsqlRest 3.21 JIT · SQL files29135 (SQL files)1647appsettings.json
PostgREST 16.616205 (functions)22126postgrest.conf
NpgsqlRest 4.1 AOT · functions21205 (functions)22614appsettings.json
NpgsqlRest 4.1 JIT · functions21205 (functions)2266appsettings.json
NpgsqlRest 3.21 AOT · functions21205 (functions)22619appsettings.json
NpgsqlRest 3.21 JIT · functions21205 (functions)22615appsettings.json
PostGraphile 5.2 (GraphQL)44205 (functions)24929graphile.config.mjs
Laravel Octane 13.4399205 (functions)30430api.php
.NET 11 · EF Core116205 (functions)32124Program.cs
.NET 10 · EF Core116205 (functions)32125Program.cs
Fastify 5.12129205 (functions)33420app.js
Express 5.3130205 (functions)33523app.js
NestJS 12.6135205 (functions)34022perf.controller.ts
FastAPI 0.165152205 (functions)35727app.py
.NET 11 · Dapper155205 (functions)36016Program.cs
.NET 10 · Dapper155205 (functions)36011Program.cs
Hasura 2.50 (GraphQL)86277 (functions and wrappers)36328databases.yaml
Bun 1.4173205 (functions)3783app.ts
Deno 2.9176205 (functions)3815app.ts
Spring Boot 4.2 (Java 25)189205 (functions)39421Application.java
Django 6.1252205 (functions)45731views.py
.NET 11 · plain Npgsql281205 (functions)48613Program.cs
.NET 10 · plain Npgsql281205 (functions)4868Program.cs
Swoole 6.2 (PHP)295205 (functions)50018server.php
Axum 0.8 (Rust)334205 (functions)53910main.rs
Actix-web 4.20 (Rust)345205 (functions)55012main.rs
Gin 1.12 (Go)368205 (functions)5731main.go
Go 1.27 · net/http408205 (functions)6132main.go
  • The generated APIs need 12 to 86 lines of their own, all of it configuration. A hand-written service needs 99 to 408 lines of code for the same nine endpoints.
  • NpgsqlRest with SQL files is the least to write in total: 164 lines, because the statement is the endpoint and there is no function around it.
  • The fastest services are the longest. Go (408 lines), Gin and the two Rust services are at the top of the leaderboard and at the bottom of this chart: every type conversion and every row mapping is written out by hand. NpgsqlRest is the one group that is near the top of both.
  • Fewer lines is also fewer tokens. Code that an AI assistant has to read, write and keep consistent is priced by its length, and a nine-endpoint API that is 21 lines of configuration leaves little to get wrong.

Latency objectives ​

Every test has an objective for the 99th percentile of the response time: 100 ms in the minimal request test, 500 ms with many parameters, 5 s for large payloads and 1 s in the others. 1354 of 1,364 tests met it. The 10 that did not:

ServiceKind of testTestp99 (ms)
Django 6.1Minimal request500 users249
Django 6.1Data types200 users, 500 rows1,141
FastAPI 0.165Minimal request500 users135
FastAPI 0.165Data types100 users, 500 rows1,243
FastAPI 0.165Data types200 users, 500 rows2,454
Hasura 2.50 (GraphQL)Minimal request500 users154
Laravel Octane 13.43Minimal request200 users445
Laravel Octane 13.43Minimal request500 users696
Laravel Octane 13.43Many parameters200 users501
PostGraphile 5.2 (GraphQL)Data types200 users, 500 rows1,474

All tests are closed-loop: a virtual user sends its next request when the previous one is answered. A slow service is therefore sent fewer requests, and its latency looks better than it would under the load a fast service handled. Compare latency between services with similar throughput.

How to read all of this ​

  • Positions hide distances; the score shows them. Many services in the middle of the leaderboard are within a few percentage points of each other.
  • Marked results are floors. Where a chart says k6 limit, the service was faster than the tool measuring it.
  • This is one machine and one database design. Every service calls the same PostgreSQL functions on a 48-core server, with 4 cores for the service. Other hardware and other workloads move the numbers.
  • Some services do less work in two kinds of test. Eight of them return JSON columns as strings; see POST body and nested JSON.
  • Everything is in the open. The dataset has every measurement of every test.

Previous: ← Introduction · Next: Data Types →

Comments