Skip to content

perf(nuxt): reduce dev pages startup work - #35383

Merged
danielroe merged 2 commits into
mainfrom
perf/dev-pages-startup
Jun 18, 2026
Merged

danielroe merged 2 commits into
mainfrom
perf/dev-pages-startup

Conversation

@TheAlexLichter

Copy link
Copy Markdown
Member

📚 Description

This PR reduces page-related work during nuxt dev.

  • It skips an early typed-router page scan in normal dev mode. Dev still scans pages during app:templatesGenerated.
  • It also removes the page-meta TypeScript transform path and instead unwraps TS AST nodes directly, so static definePageMeta values using as, satisfies, etc. can still be extracted without the extra transform.
    • My first approach was with a huge regex and Rolldown's transform
    • But the walking was way more performant!

@github-actions github-actions Bot added 5.x ⚡ performance Performance degradation or optimization opportunity labels Jun 17, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@35383

@nuxt/nitro-server

npm i https://pkg.pr.new/@nuxt/nitro-server@35383

nuxt

npm i https://pkg.pr.new/nuxt@35383

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@35383

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@35383

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@35383

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@35383

commit: ef87ffa

@codspeed

codspeed Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 15.95%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
✅ 19 untouched benchmarks
⏩ 3 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ writeTypes in the basic-types fixture 59.4 ms 48.7 ms +21.9%
⚡ initial dev server build in the basic test fixture 780.2 ms 707.5 ms +10.28%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing perf/dev-pages-startup (ef87ffa) with main (f95ca1e)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@TheAlexLichter
TheAlexLichter marked this pull request as ready for review June 17, 2026 19:12
@coderabbitai

This comment has been minimized.

@danielroe
danielroe added this pull request to the merge queue Jun 18, 2026
Merged via the queue into main with commit f0cac23 Jun 18, 2026
46 of 48 checks passed
@danielroe
danielroe deleted the perf/dev-pages-startup branch June 18, 2026 12:15
@github-actions github-actions Bot mentioned this pull request Jun 18, 2026
2 of 5 tasks
@github-actions github-actions Bot mentioned this pull request Jun 24, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Jul 17, 2026
5 of 6 tasks
@github-actions github-actions Bot mentioned this pull request Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.x ⚡ performance Performance degradation or optimization opportunity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants