Fastify is 7x Faster than Next.js
a year ago
- #SSR
- #Performance
- #Frameworks
- Revisiting SSR performance with @fastify/vue and @fastify/react at 1.0.0, now including metaframeworks like Nuxt and Next.
- Next.js setup involved create-next-app, App Router, and dynamic rendering to prevent prerendering.
- @fastify/react version required minimal changes, updating server.js and vite.config.js to use @fastify/react.
- Nuxt version used create-nuxt-app, transforming the HTML shell into a Vue component with Nuxt-specific tags.
- @fastify/vue version mirrored @fastify/react's approach, copying original code and updating configurations.
- Performance results: @fastify/vue (717 rps), Nuxt (561 rps), @fastify/react (347 rps), Next.js (49 rps).
- @fastify/react is 7x faster than Next.js, raising questions about Next.js overhead despite production settings.
- Discussion on the trade-offs between minimal frameworks (@fastify/vue, @fastify/react) and comprehensive solutions (Next.js, Nuxt).
- Highlighting the core functionality of SSR frameworks: seamless CSR to SSR transition and SPA behavior.
- Theo provides further analysis on the performance differences.