Coding Horizon

Next.js Has an Astro Problem and the Numbers Show It

Every figure, name and claim the finished video puts on screen, with where it came from. Figures that were measured rather than quoted say how they were measured.

How the measurements were taken

Both projects were created from each framework’s own scaffolding tool, with no files added and no configuration changed, and were measured on the same machine in the same session.

Sources: create-next-app, Astro install guide.

JavaScript the home page downloads

  Next.js 16.2.12 Astro 7.1.6
script files the page requests 8 0
JavaScript, uncompressed 627 kB 0 kB
JavaScript, gzipped 186 kB 0 kB
HTML document, gzipped 2.7 kB 0.21 kB

Method: the Next.js project was built with next build and served with next start, the home page HTML fetched, every <script src> in it collected, each file read from .next/static and gzipped. The Astro project was built with astro build and its dist/ directory listed: it contains index.html, favicon.ico and favicon.svg, and no JavaScript file at all.

The eight scripts and their gzipped sizes, as shown on screen: 69.3 kB, 48.0 kB, 38.7 kB, 13.5 kB, 7.3 kB, 5.5 kB, 4.0 kB and 0.3 kB.

Caveat: these are the defaults of a scaffolded project on the day they were measured, not a fixed property of either framework. Both change with every release, and a real page adds its own code on top.

Installed dependency tree

  Next.js Astro
node_modules on disk 358 MB 163 MB
files in node_modules 9,991 8,996

Method: du -sm node_modules after a clean install in each project.

Cold production build

  Next.js Astro
build, from a removed output directory 3.3 s 1.5 s

Method: rm -rf .next / rm -rf dist, then the framework’s own build command under /usr/bin/time -p, wall clock. Next.js 16 builds with Turbopack by default, which is why this gap is much smaller than it used to be.

Caveat: a one page project is close to the best case for both, and build time on a real project is dominated by the project rather than the framework.

What each framework ships, and why

Developer sentiment

Documentation aimed at models

Not verified