#3675·nextra

Extremely slow compilation and high resource usage, even on v4 with turbopack

Author: oprypkhantcCreated Nov 8, 2024Updated Jun 18, 2026
Labelsbug

Describe the bug

Hey.

On the latest v4 release (version .22), the nextra-docs template takes >60sec to render the "Documentation" page, while using 300-400% CPU and 1.8GB of RAM on a modern MacBook Pro.

In of itself, a cold start taking some time isn't a huge problem; but even next renders (after changing a single page of content) still take >10sec to complete, all while using 2GB of RAM. Turbopack doesn't help at all here; it just uses 8x-10x times RAM, without any visible improvement to render time.

There is an old closed issue, mentioning that NextJS development is slow, but this really isn't the case with an example app from NextJS - where builds take <100ms. The difference is more than 100x in this case between a clean example NextJS app and a Nextra Docs template, which seems suspicious :)

To Reproduce

  1. Clone the examples/docs template from v4-v2 branch
  2. Install deps, run the NextJS server: yarn run next dev
  3. Navigate to http://localhost:3000/docs, wait for it to render
  4. Change anything in content/index.mdx
  5. See the change after 10-20sec

Expected behavior

Rerenders should probably be faster.

Screenshots

An example of how much resources initial render with Turbopack uses (some of it is shared memory, but still):

Screenshot 2024-11-08 at 23 59 44