Back to articles
I Benchmarked Fastify 5 vs Express 4 on the Same API — Here Are the Numbers

I Benchmarked Fastify 5 vs Express 4 on the Same API — Here Are the Numbers

via Dev.to WebdevDevForge Templates

Express has been the default Node.js framework for over a decade. Most tutorials use it, most teams know it, and it works fine for a lot of things. But "works fine" and "performs well" are different conversations. I built the same API twice -- once with Express 4.21 and once with Fastify 5.2 -- and ran them through identical benchmarks. The gap was larger than I expected. The Setup Both APIs implement the same 10 routes: full CRUD for users, products, and orders, plus a health check. Same Prisma 7 ORM, same PostgreSQL 16 database, same seed data (1,000 users, 5,000 products, 10,000 orders). Same machine: M2 MacBook Pro, 16GB RAM, Node.js 22. The routes include joins (orders with user + product data), pagination, filtering, and JSON serialization of nested objects -- the kind of work a real API does. Benchmarks ran with autocannon -- 100 concurrent connections, 30-second duration, repeated 5 times per endpoint. Numbers below are averages across all 10 routes. The Numbers Metric Express

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
2 views

Related Articles