Skip to main content
Version: 0.4

NestJS: Xisto vs Bun

The same NestJS app, not one line changed, built with Xisto or run on Bun. On Bun it runs as the TFB's own Nest app does: compiled with tsc, one process per CPU with node:cluster. On Xisto, in two processes on one port (each with its own singletons, as the cluster) and in one process with workers and the handler lock. The setup and both apps are described on NestJS.

The app built with Xisto in two processes against NestJS on Bun, at a glance:

  • json: 54,049 against 27,306 requests per second at best (1.98× more), with 2.0× less CPU per request and 14.4× less memory (16.2 MB against 233.3 MB).
  • plaintext: 239,831 against 29,629 requests per second at best (8.09× more), with 7.9× less CPU per request and 20.1× less memory (73.8 MB against 1480.4 MB).

Conduit: a real NestJS app​

Conduit is the public RealWorld example built with NestJS: controllers, guards, JWT, argon2, a Postgres database and a Redis cache. The same source, not one line changed, built with Xisto (main c684667) and run on Bun 1.4.4 (the same npm run build output), on an Apple M4 (10 cores), 15 Nov 2026; Postgres 16 and Redis 7 in local containers. 20 connections, 30 s per route, startup the median of 5 fresh starts, cold latency the median of 10; every request of every run answered correctly. Source: bench/results/conduit-mac-2026-11-15.txt (Xisto, Node and Bun in one session).

Conduit: Xisto's requests per second ÷ Bun's, per route (above 1× Xisto answers more)
00.511.5current user (guard, JWT, query)1.13×login (argon2)1.48×tags1.15×article list (2 queries)0.78×article by slug0.62×article list, no cache1.14×article by slug, no cache1.14×

20 connections, 30 s per route; the first five with the Redis cache warm, the last two with Redis stopped. The dashed line is 1×; grey: the routes where Bun answers more. Every value is in the tables below.

Conduit: CPU time per 1,000 requests, in ms, with the cache warm (lower is better)
020406080100current user · Xisto63.1current user · Bun83.0tags · Xisto26.7tags · Bun31.1article list · Xisto43.9article list · Bun35.5article by slug · Xisto25.0article by slug · Bun14.5

The server's user + system time over the run divided by the requests it answered; login (argon2: 127 s against 221 s per 1,000) is in the table.

Conduit: memory at rest and after the load, in MB (lower is better)
050100150at rest · Xisto7.5at rest · Bun76.5after the load · Xisto11.6after the load · Bun130.8

Resident memory of the server process; startup to the first 200: 26 ms with Xisto, 214 ms with Bun.

Bun is ahead on the two routes served from the cache: the article list (19,572 against 15,361 requests per second) and the article by slug (38,660 against 23,803), with less CPU per request and a lower p99 on both. Xisto answers more on the current user (guard, JWT and a query), the tags, the login and both routes without the cache, with less CPU on all of them and a lower p99 on all of them but the cached ones. Memory is where the two differ most: Bun holds 131 to 259 MB under load (758 MB during the argon2 logins), Xisto 11 to 13 MB (203 MB during the logins); at rest 76.5 against 7.5 MB, and Bun starts in 214 ms against 26.

XistoBun
startup (to the first 200)26 ms214 ms
RSS at rest7.5 MB76.5 MB
RSS after the load11.6 MB130.8 MB

Under load, with the Redis cache warm:

routeXisto req/sBun req/sXisto p99Bun p99Xisto CPU per 1k reqBun CPU per 1k reqXisto RSSBun RSS
article list (2 queries)15,36119,5722.81 ms2.35 ms43.9 ms35.5 ms12.5 MB258.8 MB
article by slug23,80338,6602.03 ms1.46 ms25.0 ms14.5 ms11.5 MB155.8 MB
current user (guard, JWT, query)8,1347,2134.27 ms5.53 ms63.1 ms83.0 ms11.2 MB131.3 MB
tags17,37315,1242.40 ms3.06 ms26.7 ms31.1 ms11.0 MB131.5 MB
login (argon2)6544379.83 ms877.17 ms127,182.7 ms220,663.1 ms203.3 MB757.6 MB

Without the cache (Redis stopped; every request reads Postgres):

routeXisto req/sBun req/sXisto p99Bun p99Xisto CPU per 1k reqBun CPU per 1k reqXisto RSSBun RSS
article list5,9565,2376.10 ms7.59 ms92.1 ms114.6 ms11.5 MB150.4 MB
article by slug8,5507,5084.15 ms4.84 ms32.2 ms56.1 ms11.6 MB130.8 MB

Single-request latency, cold (cache flushed) / warm, in ms:

routeXistoBun
article list2.09 / 0.652.64 / 0.53
article by slug2.14 / 0.502.25 / 0.48
current user1.71 / 0.721.74 / 1.11
tags1.44 / 0.501.09 / 0.50
login21.83 / 22.7529.60 / 28.53

The TFB app: json​

15 Nov 2026 round (main f766bf8): the server on the Xeon E5-2686 v4 (2 vCPUs), wrk 4.2.0 on the Graviton2, the TFB's levels and rules, 15 s per level, the median of 3 runs.

json: best requests per second (higher is better)
020k40k60kXisto + NestJS (2 processes)54kXisto + NestJS (lock)44kNestJS on Bun27k

The best of the levels, median of 3 runs at each level; Xisto in the accent colour. Every value is in the tables below.

json: Xisto + NestJS (2 processes) requests per second ÷ NestJS on Bun's, at each level (above 1× Xisto answers more)
00.511.522.516 connections1.33×32 connections1.63×64 connections1.97×128 connections1.98×256 connections1.94×512 connections2.03×

The dashed line is 1×, the same requests per second. Accent: the levels where Xisto answers more; grey: where NestJS on Bun does.

json: requests per second by number of connections (higher is better)
  • Xisto + NestJS (2 processes)
  • Xisto + NestJS (lock)
  • NestJS on Bun
020k40k60k163264128256512connections

Every level of the round; the values are in the table below.

json: CPU time per 1,000 requests, in ms (lower is better)
020406080Xisto + NestJS (2 processes)36.1Xisto + NestJS (lock)36.8NestJS on Bun72.1

The server's user + system time over the run at its best level, divided by the requests it answered.

json: peak memory of all the server's processes, in MB (lower is better)
050100150200250Xisto + NestJS (lock)10.7Xisto + NestJS (2 processes)16.2NestJS on Bun233.3

The largest resident set size summed over all the server processes, across every level.

json: p99 latency by number of connections (lower is better, log scale)
  • Xisto + NestJS (2 processes)
  • Xisto + NestJS (lock)
  • NestJS on Bun
1 ms10 ms100 ms163264128256512connections

The 99th percentile of each level's median run, as wrk reports it; each step of the axis is ten times the one below. A level without a value had no p99 in wrk's output.

json in numbers​

server163264128256512
Xisto + NestJS (2 processes)28,05642,58752,81954,04952,43253,117
Xisto + NestJS (lock)27,12537,78343,51444,17043,61142,763
NestJS on Bun21,17126,14926,80727,30627,01326,174

Requests per second at each number of connections. Xisto + NestJS (no lock) crashed under load.

serverbest req/sconnections therep50 therep99 thereCPU ms per 1k requestspeak RSS
Xisto + NestJS (2 processes)54,0491281.8 ms11.3 ms36.116.2 MB
Xisto + NestJS (lock)44,1701282.5 ms10.4 ms36.810.7 MB
NestJS on Bun27,3061284.4 ms13.0 ms72.1233.3 MB

p99 at each level:

server163264128256512
Xisto + NestJS (2 processes)1.6 ms1.9 ms5.5 ms11.3 ms18.7 ms31.8 ms
Xisto + NestJS (lock)1.9 ms2.4 ms5.0 ms10.4 ms16.9 ms29.8 ms
NestJS on Bun2.6 ms3.9 ms7.6 ms13.0 ms23.0 ms35.3 ms

The TFB app: plaintext​

plaintext: best requests per second (higher is better)
050k100k150k200k250kXisto + NestJS (2 processes)240kXisto + NestJS (lock)116kNestJS on Bun30k

The best of the levels, median of 3 runs at each level; Xisto in the accent colour. Every value is in the tables below.

plaintext: Xisto + NestJS (2 processes) requests per second ÷ NestJS on Bun's, at each level (above 1× Xisto answers more)
0246810256 connections8.51×1,024 connections7.58×4,096 connections7.12×16,384 connections8.32×

The dashed line is 1×, the same requests per second. Accent: the levels where Xisto answers more; grey: where NestJS on Bun does.

plaintext: requests per second by number of connections (higher is better)
  • Xisto + NestJS (2 processes)
  • Xisto + NestJS (lock)
  • NestJS on Bun
0100k200k300k2561,0244,09616,384connections

Every level of the round; the values are in the table below.

plaintext: CPU time per 1,000 requests, in ms (lower is better)
020406080Xisto + NestJS (2 processes)8.5Xisto + NestJS (lock)11.9NestJS on Bun67.3

The server's user + system time over the run at its best level, divided by the requests it answered.

plaintext: peak memory of all the server's processes, in MB (lower is better)
05001.0k1.5kXisto + NestJS (2 processes)73.8Xisto + NestJS (lock)74.9NestJS on Bun1480.4

The largest resident set size summed over all the server processes, across every level.

plaintext in numbers​

server2561,0244,09616,384
Xisto + NestJS (2 processes)239,831224,576208,115159,455
Xisto + NestJS (lock)115,557112,929109,77984,875
NestJS on Bun28,18429,62929,23219,171

Requests per second at each number of connections (HTTP pipelining 16 deep). Xisto + NestJS (no lock) crashed under load.

serverbest req/sconnections therep50 therep99 thereCPU ms per 1k requestspeak RSS
Xisto + NestJS (2 processes)239,8312569.7 ms30.9 ms8.573.8 MB
Xisto + NestJS (lock)115,55725620.1 ms—11.974.9 MB
NestJS on Bun29,6291,024297 ms1000 ms67.31480.4 MB

p99 at each level:

server2561,0244,09616,384
Xisto + NestJS (2 processes)30.9 ms92.6 ms402 ms2880 ms
Xisto + NestJS (lock)—192 ms1380 ms3300 ms
NestJS on Bun185 ms1000 ms2940 ms7420 ms

See also​