Skip to content

Benchmarks

How NestRS 7.0 measures against NestJS 12.4 on node:http, its fastest adapter — the results, the contract, the protocol, and how to run them.

NestRS is measured against idiomatic NestJS 12.4 on its NodeAdapter (@nestjs/platform-node), which runs Nest straight on Node’s node:http. NestJS recommends it since 12.3, makes it the default in 13, and measures it ahead of both Express and Fastify — so it is the one contestant worth racing, and the slower adapters are not run. Both sides serve a byte-identical HTTP contract at the same stack depth; the harness ships in the repository, and one command runs its protocol on your hardware.

Terminal window
git clone https://github.com/YV17labs/NestRS && cd NestRS/bench
just bench

Each server pinned to one core — the regime that favours Node, whose event loop loses nothing to pinning — and the load generator on separate cores; medians of two rounds of five timed runs.

1 pinned coreNestRS 7.0NestJS 12.4 · node:httpNestRS ahead
T0 · static text~204k req/s · p99 0.41 ms~160k req/s · p99 0.77 ms×1.3 · p99 ×1.9
T1 · hello, JSON through DI~201k req/s · p99 0.43 ms~154k req/s · p99 0.81 ms×1.3 · p99 ×1.9
T2 · guard + interceptor~183k req/s · p99 0.46 ms~93k req/s · p99 1.32 ms×2.0 · p99 ×2.9
T3 · streamed body~173k req/s · p99 0.53 ms~44k req/s · p99 6.75 ms×4.0 · p99 ×13
T4 · JSON body read~196k req/s · p99 0.46 ms~94k req/s · p99 1.31 ms×2.1 · p99 ×2.9
T5 · 35 KB JSON body~20k req/s · p99 3.66 ms~17k req/s · p99 7.47 ms×1.2 · p99 ×2.0
Memory idle6 MB103 MB×17
Memory under load8–11 MB87–186 MB×10–17
Cold start → first 200~10 ms~220 ms×22

On a bare hello world, node:http keeps NestJS within a third of NestRS. The gap opens as soon as the framework does a framework’s work — a guard and an interceptor on the route, a request body decoded into a DTO, a streamed reply — and the tail stays two to thirteen times shorter on every tier. NestRS writes its access line on every request and NestJS writes none; with that line off (the quiet variant), T1 reaches ~261k req/s, ×1.7.

Given four cores, one NestRS process takes all of them: T1 ~278k req/s, T2 ~289k, T4 ~320k, while a NestJS process stays on its one event loop at ~154k, ~93k and ~93k — ×1.8 to ×3.5 for one process each. These are floors: 64 connections cap what a closed-loop load reaches at this latency. Node scales out by running one ~100 MB process per core; NestRS by giving its one process the cores.

Measured 2026-11-11 on a 14-core Apple-silicon host, in a Linux VM (OrbStack, kernel 7.2) — rustc 1.97.1, Node 26.13.0, @nestjs/core 12.4.2, oha 1.16; 64 connections, a discarded 10 s warmup, five timed runs of 15 s per tier; cold start is the median of the boots. Absolute figures move with hardware, and a virtualized host is a floor: the ratios are the claim — every run embeds its machine fingerprint, and the one command above replays the full protocol on yours.

Every contestant serves the exact same surface, verified before anything is measured:

  • Same bytes. Status, media type, and body compared byte for byte against golden files by a conformance gate. A contestant that fails the gate is never benchmarked.
  • Same depth. The measured route must traverse router → DI-built controller → injected service → the framework’s standard JSON path. Inlining the response, bypassing DI, or hand-rolling serialization disqualifies the contestant — enforced by review, and the sources are deliberately small enough to read.
  • Same posture. Each side is written the way its own CLI scaffolds it — release build vs NODE_ENV=production, framework defaults untouched but NestJS’s adapter, swapped for NodeAdapter as its HTTP adapters page shows, no per-request telemetry on either side, no reverse proxy, no TLS. Logging stays as each ships it: NestRS writes its one access line per request.
TierRouteWhat it adds
T0GET /pingthe transport floor: a static string
T1GET /hellorouter, DI-built controller, injected service, JSON
T2GET /layeredT1 behind a guard and an interceptor bound on the route
T3GET /streama body streamed in sixteen chunks
T4POST /echoa JSON request body read and decoded
T5GET /largea 35 KB JSON body

A contestant may declare variants of its own, measured in a boot of their own and never compared with a contestant that lacks them: NestRS declares T1 over HTTP/2 with prior knowledge, T1 with its access line off, and T5 compressed.

  • Server and load generator pinned to disjoint CPU sets — they never share a core.
  • Per tier: a discarded warmup, then repeated timed runs; medians reported, raw output kept.
  • Headline figures use the single-core regime — Node’s best case. A multi-core regime is reported beside it, where tokio’s multi-threaded runtime pulls further ahead.
  • Every result embeds its fingerprint: CPU, kernel, toolchains, resolved dependency versions, and the exact protocol parameters.
  • The harness compares framework overhead on a hello-world contract. It does not claim your domain logic gets 1.5× faster — it claims the floor under it is lower and the ceiling higher.
  • Neither side ships per-request telemetry — measuring “telemetry on” vs “telemetry absent” would compare features, not frameworks. NestRS’s access line is measured on, as it ships, and off in its quiet variant.
  • No database route, GraphQL, WebSocket, MCP or queue throughput, no TLS, and no PHP or Go contestant yet.
  • Adding a contestant is a directory with a manifest — the harness knows no framework. The contract, the gate, and the how-to live in bench/.
  • Why NestRS — what the framework carries beyond the numbers.
  • Why not axum? — same native core; the comparison that actually matters.
  • Getting started — scaffold the same hello and measure it yourself.