Skip to content

Large Payload: 100 KB and 500 KB Responses ​

Benchmark · November 2026 · Large payload

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 text column of 100 KB or 500 KB. One response is as large as hundreds of ordinary ones, so this measures how a service moves a lot of bytes: whether it streams them to the client as they arrive from the database or builds the whole response in memory first.

It is run at 25 and 50 users at the same time. This is the kind of test with the largest differences between versions of the same software, and the one where memory use tells as much as throughput (see Resources).

The code that ran: the load script scenarios/large-payload.js, the PostgreSQL function in init.sql (for the NpgsqlRest SQL file services: perf-large-payload.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 ​

  • NpgsqlRest 4.1 takes the first two places in the main test, and four of the first five. Version 4.1 streams the response to the client as it arrives from PostgreSQL; version 3.21 built it in memory first.
  • The same software, 3.3 times faster. NpgsqlRest 3.21 (AOT, functions) does 2,574 requests per second here and 4.1 does 8,371. It is the largest change between two versions of any service in this round.
  • At 500 KB PostgreSQL becomes the limit for the fastest services (the PG limit tag): producing half a megabyte of text costs the database more than forwarding it costs the service.
  • FastAPI is first at 500 KB, its best result in the series by far.

Of the 124 tests on this page, the service was out of CPU in 24, the load generator in 0, PostgreSQL in 14, and nothing in 86 (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 the size, 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 (25 users, 100 KB), which the summary tables of the series use.

Users at the same time
Size of the response
Show
Requests per second: 25 users, 100 KB

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

  1. 1NpgsqlRest 4.1 JIT · SQL files8,786req/s
  2. 2NpgsqlRest 4.1 AOT · SQL files8,617req/s
  3. 3Fastify 5.128,584req/s
  4. 4NpgsqlRest 4.1 JIT · functions8,528req/s
  5. 5NpgsqlRest 4.1 AOT · functions8,371req/s
  6. 6Axum 0.8 (Rust)8,289req/s
  7. 7Deno 2.98,273req/s
  8. 8Go 1.27 · net/http8,251req/s
  9. 9Actix-web 4.20 (Rust)8,118req/s
  10. 10NestJS 12.67,891req/s
  11. 11Gin 1.12 (Go)7,670req/s
  12. 12Express 5.37,575req/s
  13. 13FastAPI 0.1656,860req/s
  14. 14Bun 1.46,840req/s
  15. 15.NET 10 · Dapper6,565req/s
  16. 16Swoole 6.2 (PHP)6,419req/s
  17. 17.NET 10 · plain Npgsql6,163req/s
  18. 18.NET 11 · plain Npgsql5,762req/s
  19. 19.NET 11 · Dapper5,747req/s
  20. 20PostGraphile 5.2 (GraphQL)5,549req/s
  21. 21Hasura 2.50 (GraphQL)4,439req/s
  22. 22.NET 10 · EF Core4,309req/s
  23. 23PostgREST 16.64,211req/s
  24. 24.NET 11 · EF Core4,009req/s
  25. 25Spring Boot 4.2 (Java 25)3,342req/s
  26. 26NpgsqlRest 3.21 JIT · functions3,289req/s
  27. 27NpgsqlRest 3.21 JIT · SQL files3,210req/s
  28. 28NpgsqlRest 3.21 AOT · functions2,574req/s
  29. 29NpgsqlRest 3.21 AOT · SQL files2,446req/s
  30. 30Django 6.12,039req/s
  31. 31Laravel Octane 13.431,374req/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 25 users at the same time, 100 KB, NpgsqlRest 4.1 JIT · SQL files is first with 8,786 requests per second, 2.0% ahead of NpgsqlRest 4.1 AOT · SQL files. 9 of the 31 services are within 10% of the leader, and the slowest does 1,374.

The best of each platform ​

The fastest service of every platform in the main test (25 users, 100 KB). "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
NpgsqlRestNpgsqlRest 4.1 JIT · SQL files18,786100%appsettings.json
Node.jsFastify 5.1238,58498%app.js
RustAxum 0.8 (Rust)68,28994%main.rs
Bun & DenoDeno 2.978,27394%app.ts
GoGo 1.27 · net/http88,25194%main.go
PythonFastAPI 0.165136,86078%app.py
.NET.NET 10 · Dapper156,56575%Program.cs
PHPSwoole 6.2 (PHP)166,41973%server.php
GraphQLPostGraphile 5.2 (GraphQL)205,54963%graphile.config.mjs
PostgRESTPostgREST 16.6234,21148%postgrest.conf
JavaSpring Boot 4.2 (Java 25)253,34238%Application.java

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
1NpgsqlRest 4.1 JIT · SQL files8,7861.864.42.413,63913112%—
2NpgsqlRest 4.1 AOT · SQL files8,6171.924.42.453,5126412%—
3Fastify 5.128,5841.974.62.343,67063911%—
4NpgsqlRest 4.1 JIT · functions8,5281.964.52.223,83512159%—
5NpgsqlRest 4.1 AOT · functions8,3712.024.52.273,6905257%—
6Axum 0.8 (Rust)8,2892.094.42.643,1403711%—
7Deno 2.98,2732.194.62.812,94646443%—
8Go 1.27 · net/http8,2512.095.13.022,7283443%—
9Actix-web 4.20 (Rust)8,1182.224.42.363,4384910%—
10NestJS 12.67,8912.324.83.002,63274610%—
11Gin 1.12 (Go)7,6702.305.73.072,4983939%—
12Express 5.37,5752.296.82.972,5476599%—
13FastAPI 0.1656,8602.854.43.571,9242187%service
14Bun 1.46,8402.776.73.022,26820733%—
15.NET 10 · Dapper6,5652.579.13.082,1311304%—
16Swoole 6.2 (PHP)6,4193.175.42.782,310948%—
17.NET 10 · plain Npgsql6,1632.769.12.702,2851134%—
18.NET 11 · plain Npgsql5,7622.819.62.322,4841353%—
19.NET 11 · Dapper5,7472.829.62.372,4261253%—
20PostGraphile 5.2 (GraphQL)5,5492.9414.73.561,5571,30934%service
21Hasura 2.50 (GraphQL)4,4394.258.53.061,45062432%—
22.NET 10 · EF Core4,3094.0312.23.011,4321643%—
23PostgREST 16.64,2114.398.82.491,6938824%—
24.NET 11 · EF Core4,0094.2413.42.651,5121573%—
25Spring Boot 4.2 (Java 25)3,3426.2711.23.291,0161,28034%—
26NpgsqlRest 3.21 JIT · functions3,2894.8917.02.821,16517737%—
27NpgsqlRest 3.21 JIT · SQL files3,2104.9817.52.851,1271677%—
28NpgsqlRest 3.21 AOT · functions2,5746.5119.62.161,19110036%—
29NpgsqlRest 3.21 AOT · SQL files2,4466.8820.42.091,1691027%—
30Django 6.12,0399.8718.53.455922885%service
31Laravel Octane 13.431,37414.6632.33.793628453%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.

Service25 users, 100 KB25 users, 500 KB50 users, 100 KB50 users, 500 KB
NpgsqlRest 4.1 JIT · SQL files8,7861,79010,765ᵖ1,791
NpgsqlRest 4.1 AOT · SQL files8,6171,25310,522ᵖ1,905
Fastify 5.128,5842,12710,754ᵖ2,338
NpgsqlRest 4.1 JIT · functions8,5281,55810,678ᵖ1,752
NpgsqlRest 4.1 AOT · functions8,3711,25110,604ᵖ1,467
Axum 0.8 (Rust)8,2892,25310,074ᵖ2,472ᵖ
Deno 2.98,2732,0169,8212,170
Go 1.27 · net/http8,2512,28310,0862,635
Actix-web 4.20 (Rust)8,1182,2629,954ᵖ2,476ᵖ
NestJS 12.67,8911,59110,0191,763
Gin 1.12 (Go)7,6702,2359,4212,589
Express 5.37,5751,7549,3062,004
FastAPI 0.1656,8602,4417,6882,780ᵖ
Bun 1.46,8401,9638,2812,300
.NET 10 · Dapper6,5651,9927,5342,279
Swoole 6.2 (PHP)6,4191,8408,5252,256
.NET 10 · plain Npgsql6,1631,9818,0452,325
.NET 11 · plain Npgsql5,7622,0657,8922,377ᵖ
.NET 11 · Dapper5,7472,0177,8282,385ᵖ
PostGraphile 5.2 (GraphQL)5,5491,2525,9201,406
Hasura 2.50 (GraphQL)4,4391,7873,2701,890ᵖ
.NET 10 · EF Core4,3091,8095,3481,831
PostgREST 16.64,2111,2274,7001,316ᵖ
.NET 11 · EF Core4,0091,9965,3972,284
Spring Boot 4.2 (Java 25)3,3427223,770757
NpgsqlRest 3.21 JIT · functions3,2891,3874,7501,346
NpgsqlRest 3.21 JIT · SQL files3,2101,3914,8021,576
NpgsqlRest 3.21 AOT · functions2,5746733,2621,135
NpgsqlRest 3.21 AOT · SQL files2,4469883,2411,275
Django 6.12,0398652,021895
Laravel Octane 13.431,3748531,399884

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: ← Nested JSON · Next: Many Parameters →

Comments