Skip to content

feat: add POST benchmark scenario - #489

Merged
Tony133 merged 3 commits into
fastify:mainfrom
gurgunday:feat/post-benchmarks
Oct 19, 2026
Merged

Tony133 merged 3 commits into
fastify:mainfrom
gurgunday:feat/post-benchmarks

Conversation

@gurgunday

Copy link
Copy Markdown
Member

Happy to announce the results of my recent performance work! It was focused mostly on cases where there is a request body. Therefore a new simple POST benchmark was added.

Version Req/s vs Fastify Avg latency p99
node-http v24.21.0 126,400 +4.0% 7.39 ms 17 ms
fastify 5.12.7 121,510 7.75 ms 18 ms
hono 4.13.13 106,042 −12.7% 8.95 ms 19 ms
h3 2.0.1-rc.32 94,685 −22.1% 10.05 ms 21 ms
koa 3.2.1 81,356 −33.0% 11.80 ms 26 ms
express 5.3.0 75,790 −37.6% 12.69 ms 28 ms
restify 12.0.0 73,984 −39.1% 13.02 ms 28 ms
hapi 21.4.10 59,301 −51.2% 16.37 ms 33 ms

On POST, Fastify 5.10.0 was 5% slower than Hono, and 5.12.7 is 24% faster. It's pretty significant considering we're now faster than everybody else despite doing more work by default, such as protecting against prototype poisoning

I will update the website after this merges so it shows both the simple get and simple post results


More results between Fastify and Hono:

Fastify 5.12.7 vs Hono 4.13.13**: 3 rounds, autocannon -c 100 -d 40 -p 10, Node v24.21.0, darwin arm64 (15 cores). Order alternated each round.

Round Fastify req/s Hono req/s Fastify lead Fastify / Hono latency Fastify / Hono p99
1 147,678 124,406 +18.7% 6.23 / 7.50 ms 14 / 17 ms
2 172,669 143,088 +20.7% 5.22 / 6.34 ms 9 / 12 ms
3 142,564 123,408 +15.5% 6.49 / 7.57 ms 18 / 20 ms
Average 154,304 130,301 +18.4% 5.98 / 7.14 ms 13.7 / 16.3 ms

Fastify served 18.4% more requests per second on average (+15.5% to +20.7% per round) with 16.2% lower average latency, while rejecting prototype-poisoning payloads by default.

gurgunday and others added 2 commits October 18, 2026 17:26
Add a `post` scenario that sends `POST /` with a `{"hello":"world"}`
JSON body which each server parses and echoes back. POST servers live
in benchmarks/post/ for fastify, hono, h3, koa, express, restify, hapi
and node-http.

Run it with `npm start y 100 10 40 post` and compare with
`benchmark compare -s post`. Results are written to
benchmark-results-post.json and a `# POST Benchmarks` README section;
the GET scenario's output is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Benchmark new Fastify releases as soon as they are published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread .npmrc
@gurgunday
gurgunday requested review from a team and mcollina October 19, 2026 09:40

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Tony133 Tony133 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Tony133
Tony133 merged commit 1371492 into fastify:main Oct 19, 2026
8 checks passed
@gurgunday
gurgunday deleted the feat/post-benchmarks branch October 19, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants