Skip to content

feat: add POST benchmark scenario - #489

Open
gurgunday wants to merge 2 commits into
fastify:mainfrom
gurgunday:feat/post-benchmarks
Open

gurgunday wants to merge 2 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
@@ -1,4 +1,5 @@
ignore-scripts=true
min-release-age=7
min-release-age-exclude[]=fastify

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.

Could you add a comment here with the removal date, e.g. # remove after 2026-10-20?

@gurgunday gurgunday Oct 18, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Honestly I think we can keep excluding Fastify here?

The whole purpose of this repo is to benchmark Fastify against other frameworks, and both repos are under our control, so it would be good for the runner to be able to pick up the latest Fastify as soon as possible

But if you still think we shouldn't do it, I'm happy to add the 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.

Okay, I thought it was a temporary thing; let’s see what the others think—no problem for me.

@gurgunday
gurgunday requested review from a team and mcollina October 19, 2026 09:40
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.

2 participants