Repository navigation
perf(nuxt): use @nuxt/devtools-onboard as a minimal devtools shim - #36581
Conversation
|
Nothing flagged · reviewed
Architecture Data flow No data-flow sequence changed in this PR. Tip Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion 🪧 More tips
Thanks for using PR Lens! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
@nuxt/kit
@nuxt/nitro-server
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/vite-server
@nuxt/webpack-builder
commit: |
danielroe
left a comment
There was a problem hiding this comment.
I think we can defer this to 4.7 🙏
I'll wait to merge until then, but thank you ❤️
1525f8c to
768d213
Compare
d1ec451 to
8bc8350
Compare
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
Benchmark🔴 2 regressions, 🟢 2 improvements; 34 of 38 metrics unchanged, below threshold or within noise.
34 unchanged, below threshold or within noise
Full reportBaseline: Fixtures: Node.js v26.13.0 on Linux 7.0.0-1017-azure, unknown (4 cores, 15.6 GB), load average 1.83, 1.59, 0.92. Install footprintFresh
Modules loadedJavaScript modules evaluated by
|
| Fixture | baseline median | head median | delta | baseline min / max | head min / max |
|---|---|---|---|---|---|
| minimal | 710 ms | 721 ms | +1.6% | 699 ms / 733 ms | 710 ms / 739 ms |
| large | 913 ms | 919 ms | +0.7% | 895 ms / 938 ms | 891 ms / 942 ms |
nuxt dev startup
nuxt dev from process spawn until each route responds with a 200 containing its expected content. Routes are requested in order, so later routes measure the first request to a page not yet transformed. Cold runs delete .nuxt and node_modules/.cache first; warm runs keep them. Median of 5 interleaved runs after one warmup.
| Fixture / mode / metric | baseline median | head median | delta | baseline min / max | head min / max |
|---|---|---|---|---|---|
minimal / cold / start to first / |
2.95 s | 2.97 s | +0.8% | 2.92 s / 3.01 s | 2.97 s / 3.06 s |
minimal / warm / start to first / |
2.86 s | 2.86 s | +0.0% | 2.84 s / 2.89 s | 2.82 s / 2.89 s |
large / cold / start to first / |
5.03 s | 4.99 s | -0.8% | 5.02 s / 5.09 s | 4.96 s / 5.05 s |
large / cold / then /catalog/3 |
58 ms | 66 ms | +12.7% | 57 ms / 60 ms | 59 ms / 70 ms |
large / cold / then /table |
184 ms | 183 ms | -0.8% | 182 ms / 186 ms | 175 ms / 196 ms |
large / cold / then /table/plain |
29 ms | 29 ms | +0.4% | 28 ms / 29 ms | 28 ms / 30 ms |
large / warm / start to first / |
4.81 s | 4.87 s | +1.3% | 4.78 s / 4.90 s | 4.73 s / 4.97 s |
large / warm / then /catalog/3 |
57 ms | 56 ms | -0.3% | 56 ms / 57 ms | 56 ms / 65 ms |
large / warm / then /table |
178 ms | 180 ms | +1.1% | 175 ms / 182 ms | 172 ms / 185 ms |
large / warm / then /table/plain |
28 ms | 30 ms | +7.2% | 27 ms / 29 ms | 28 ms / 40 ms |
Dev server updates
Time from writing a change to a component until a dev server SSR response for / contains it, polling every 5 ms. Both dev servers run side by side and edits alternate between them. Median of 20 edits after one warmup edit.
| Fixture (edited file) | baseline median | head median | delta | baseline min / max | head min / max |
|---|---|---|---|---|---|
minimal (app/app.vue) |
28 ms | 29 ms | +0.0% | 23 ms / 62 ms | 23 ms / 65 ms |
large (app/components/base/Item0.vue) |
71 ms | 71 ms | -0.5% | 65 ms / 410 ms | 64 ms / 968 ms |
nuxt build
Wall time of nuxt build with .nuxt, .output and node_modules/.cache deleted before each run. Median of 3 interleaved runs.
| Fixture | baseline median | head median | delta | baseline min / max | head min / max |
|---|---|---|---|---|---|
| minimal | 4.53 s | 4.55 s | +0.5% | 4.47 s / 4.70 s | 4.45 s / 4.62 s |
| large | 10.97 s | 10.91 s | -0.5% | 10.90 s / 10.99 s | 10.81 s / 10.92 s |
Output of the last build of each target.
| Fixture / output | baseline | head | delta |
|---|---|---|---|
| minimal / client JS | 143.0 kB | 143.0 kB | 0.0% |
| minimal / client JS (gzip) | 53.6 kB | 53.6 kB | 0.0% |
| minimal / client JS files | 3 | 3 | 0.0% |
| minimal / client CSS | 4.5 kB | 4.5 kB | 0.0% |
minimal / server output, excluding node_modules |
694.0 kB | 694.0 kB | 0.0% |
minimal / server node_modules |
327.1 kB | 327.1 kB | 0.0% |
| large / client JS | 416.4 kB | 416.4 kB | 0.0% |
| large / client JS (gzip) | 182.4 kB | 182.4 kB | 0.0% |
| large / client JS files | 241 | 241 | 0.0% |
| large / client CSS | 0 B | 0 B | 0% |
large / server output, excluding node_modules |
1.58 MB | 1.58 MB | +0.1% |
large / server node_modules |
458.7 kB | 458.7 kB | 0.0% |
Production SSR throughput
Requests per second against the production server (node .output/server/index.mjs), 8 concurrent connections for 2 s per round, after 300 warmup requests. Both servers run side by side and rounds alternate between them. Median of 5 rounds; latency is the median of each round's median.
| Fixture / route | baseline req/s | head req/s | delta | baseline min / max | head min / max | baseline latency | head latency |
|---|---|---|---|---|---|---|---|
minimal / / |
1846 | 1770 | -4.1% | 1607 / 1927 | 1598 / 1860 | 4.0 ms | 4.2 ms |
large / / |
376 | 377 | +0.2% | 358 / 387 | 349 / 393 | 21 ms | 19 ms |
large / /catalog/3 |
387 | 381 | -1.5% | 381 / 392 | 364 / 384 | 20 ms | 20 ms |
large / /table |
50 | 50 | +0.5% | 49 / 51 | 48 / 50 | 157 ms | 158 ms |
large / /table/plain |
196 | 200 | +2.2% | 190 / 198 | 192 / 204 | 39 ms | 38 ms |
Initial page weight
Gzipped size of what each server-rendered route asks the browser to load before hydration: the entry script and every modulepreload, the stylesheets, and the HTML itself. Measured once from the last production build of each target. Apart from a few bytes of HTML that vary with the build id, these sizes are deterministic.
| Fixture / route / asset | baseline | head | delta |
|---|---|---|---|
minimal / / / JS |
48.6 kB | 48.6 kB | 0.0% |
minimal / / / JS files |
1 | 1 | 0.0% |
minimal / / / CSS |
0 B | 0 B | 0% |
minimal / / / CSS files |
0 | 0 | 0% |
minimal / / / HTML |
605 B | 602 B | -0.5% |
| minimal / all client JS | 53.6 kB | 53.6 kB | 0.0% |
| minimal / all client JS files | 3 | 3 | 0.0% |
large / / / JS |
85.2 kB | 85.2 kB | 0.0% |
large / / / JS files |
14 | 14 | 0.0% |
large / / / CSS |
0 B | 0 B | 0% |
large / / / CSS files |
0 | 0 | 0% |
large / / / HTML |
939 B | 936 B | -0.3% |
large / /catalog/3 / JS |
85.3 kB | 85.3 kB | 0.0% |
large / /catalog/3 / JS files |
15 | 15 | 0.0% |
large / /catalog/3 / CSS |
0 B | 0 B | 0% |
large / /catalog/3 / CSS files |
0 | 0 | 0% |
large / /catalog/3 / HTML |
957 B | 954 B | -0.3% |
large / /table / JS |
83.5 kB | 83.5 kB | 0.0% |
large / /table / JS files |
9 | 9 | 0.0% |
large / /table / CSS |
0 B | 0 B | 0% |
large / /table / CSS files |
0 | 0 | 0% |
large / /table / HTML |
31.7 kB | 31.7 kB | +0.0% |
large / /table/plain / JS |
83.5 kB | 83.5 kB | 0.0% |
large / /table/plain / JS files |
9 | 9 | 0.0% |
large / /table/plain / CSS |
0 B | 0 B | 0% |
large / /table/plain / CSS files |
0 | 0 | 0% |
large / /table/plain / HTML |
31.5 kB | 31.5 kB | +0.0% |
| large / all client JS | 182.4 kB | 182.4 kB | 0.0% |
| large / all client JS files | 241 | 241 | 0.0% |
ui / / / JS |
177.7 kB | 177.7 kB | 0.0% |
ui / / / JS files |
18 | 18 | 0.0% |
ui / / / CSS |
25.9 kB | 25.9 kB | 0.0% |
ui / / / CSS files |
1 | 1 | 0.0% |
ui / / / HTML |
14.6 kB | 14.6 kB | 0.0% |
ui / /blog / JS |
177.0 kB | 177.0 kB | 0.0% |
ui / /blog / JS files |
18 | 18 | 0.0% |
ui / /blog / CSS |
25.9 kB | 25.9 kB | 0.0% |
ui / /blog / CSS files |
1 | 1 | 0.0% |
ui / /blog / HTML |
9.0 kB | 9.0 kB | 0.0% |
| ui / all client JS | 224.1 kB | 224.1 kB | 0.0% |
| ui / all client JS files | 29 | 29 | 0.0% |
Interleaved runs on a shared runner. Counts are flagged on any change, client JS sizes from 0.1% and install or server sizes from 1%; timings only from 5% and when the medians fall outside each other's min / max range. Run locally with pnpm bench.
🔗 Linked issue
📚 Description
Same as #36470 but for v4.x
I have made the onboard package also accept Nuxt DevTools v3: nuxt/devtools#1122
IMO this could be considered as a non-breaking change, as Nuxt DevTools is not an API but an opt-in interface. With this, it does require existing DevTools users to install the separate
@nuxt/devtools, but I think it should be acceptable. This would also make Nuxt 4.x lighter and compatible with Nuxt DevTools v4.