Implementation
Fastify
Fastify 5.12.8 · JavaScript · Popular references · ranked
Scores
| Category | Position | Score | ± |
|---|---|---|---|
| Hello world | 3–7 | 0.51* | ±35.7% |
| Database | 3–7 | 0.88* | ±14.4% |
| Application | 5–6 | 0.76* | ±12.8% |
| Memory (high-water mark) | 10 | 0.37 | ±2.8% |
| Startup | 1–13 | 1.00≈ | ±0.0% |
Runner CPUs: EPYC 7763, EPYC 9V45, Xeon 6975P-C
Settings
- Runtime
- Node.js 26.13.1 (active LTS), NODE_ENV=production
- Server
- Fastify (node:http)
- Workers
- node:cluster with BENCH_WORKERS worker processes (2)
- Database layer
- @fastify/postgres 6.1 (node-postgres 8.23 pool), DB_POOL_SIZE / BENCH_WORKERS connections per process
- Templates
- @fastify/view 12 with EJS 7
- Logging
- none (Fastify's logger is off by default)
- Dependency source
- –
- Status
- measured
Application endpoints: mechanisms
- Validation
- JSON schemas for params, querystring and bodies (Ajv; the PUT body without type coercion): 400
- CSRF
- token (library): @fastify/csrf-protection 8 with @fastify/cookie (secret in the _csrf cookie, token in the _csrf field)
- Session store
- cookie-encrypted (library): @fastify/secure-session 8 (libsodium secretbox), key shared by the cluster processes
Tier 1 endpoints
| Endpoint | req/s | vs Axum | Efficiency (req/CPU-s) | p99 (ms) | Errors | Limits |
|---|---|---|---|---|---|---|
| /text | 144,060 (43,368–159,664) | 0.57 | 72,116 | 1.73 | 0 | |
| /json | 138,520 (41,487–155,626) | 0.57 | 69,364 | 1.81 | 0 | |
| /db-single | 23,183 (9,552–27,488) | 0.79 | 21,045 | 8.21 | 0 | PostgreSQL-bound 15/15 |
| /html | 114,279 (31,691–118,843) | 0.44 | 57,162 | 2.09 | 0 | |
| /queries?queries=20 | 1,412 (587–1,594) | 0.76 | 1,611 | 119.38 | 0 | PostgreSQL-bound 15/15 |
| /fortunes | 30,465 (11,427–33,719) | 0.72 | 15,253 | 7.82 | 0 | |
| GET /world/{id} | 22,415 (9,221–25,772) | 0.78 | 19,878 | 7.73 | 0 | PostgreSQL-bound 15/15 |
| GET /worlds | 15,440 (6,715–15,859) | 0.72 | 13,636 | 11.27 | 0 | PostgreSQL-bound 15/15 |
| POST /form | 54,607 (16,954–60,536) | 0.38 | 27,334 | 4.17 | 0 | |
| GET /me | 22,140 (9,113–24,755) | 1.39 | 15,893 | 8.49 | 0 | PostgreSQL-bound 15/15 |
| /updates?queries=20 | 710 (291–731) | 0.88 | 898 | 236.64 | 0 | PostgreSQL-bound 15/15 |
| PUT /world/{id} | 18,376 (7,513–20,088) | 0.76 | 16,164 | 9.59 | 0 | PostgreSQL-bound 15/15 |
Measured versions
@fastify/cookie11.1.5@fastify/csrf-protection8.0.2@fastify/formbody9.0.2@fastify/postgres6.1.2@fastify/secure-session8.4.2@fastify/view12.0.1bcryptjs3.0.3ejs7.0.2fastify5.12.8node26.13.1pg8.23.1
Runner jobs
| Job | CPU model | Rounds | Status |
|---|---|---|---|
| 1 | EPYC 7763 | 5 | measured |
| 2 | EPYC 9V45 | 5 | measured |
| 3 | Xeon 6975P-C | 5 | measured |