-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
performance improvement of static generation #25035
Conversation
to allow parallelizing and avoid loading the bundles in the main thread
346d41e
to
c62678b
Compare
This comment has been minimized.
This comment has been minimized.
this allows to deduplicate code in the server logic
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Failing test suitesCommit: 4b6b9cd test/integration/app-document/test/index.test.js
Expand output● Document and App › Client side › should keep state between page navigations
test/integration/scroll-back-restoration/test/index.test.js
Expand output● Scroll Restoration Support › dev mode › should restore the scroll position on navigating back
test/integration/scroll-forward-restoration/test/index.test.js
Expand output● Scroll Restoration Support › dev mode › should restore the scroll position on navigating forward
test/integration/trailing-slashes-href-resolving/test/index.test.js
Expand output● href resolving trailing-slash › dev mode › should route to /blog/first-post/ correctly
● href resolving trailing-slash › dev mode › should route to /catch-all/hello/world/ correctly
● href resolving trailing-slash › dev mode › should route to /top-level-slug/ correctly
|
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall increase
|
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
buildDuration | 16.4s | 17.3s | |
buildDurationCached | 5.1s | 4.8s | -334ms |
nodeModulesSize | 46.6 MB | 46.7 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.827 | 2.887 | |
/ avg req/sec | 884.39 | 866.01 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.69 | 1.724 | |
/error-in-render avg req/sec | 1479.28 | 1450.5 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
framework-HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
main-HASH.js gzip | 19.4 kB | 19.4 kB | ✓ |
webpack-HASH.js gzip | 994 B | 994 B | ✓ |
Overall change | 59.7 kB | 59.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
_app-HASH.js gzip | 1.02 kB | 1.02 kB | ✓ |
_error-HASH.js gzip | 3.06 kB | 3.06 kB | ✓ |
amp-HASH.js gzip | 526 B | 526 B | ✓ |
css-HASH.js gzip | 334 B | 334 B | ✓ |
hooks-HASH.js gzip | 890 B | 890 B | ✓ |
index-HASH.js gzip | 262 B | 262 B | ✓ |
link-HASH.js gzip | 1.65 kB | 1.65 kB | ✓ |
routerDirect..HASH.js gzip | 331 B | 331 B | ✓ |
withRouter-HASH.js gzip | 329 B | 329 B | ✓ |
bb14e60e810b..30f.css gzip | 125 B | 125 B | ✓ |
Overall change | 8.54 kB | 8.54 kB | ✓ |
Client Build Manifests
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
_buildManifest.js gzip | 390 B | 390 B | ✓ |
Overall change | 390 B | 390 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
index.html gzip | 560 B | 560 B | ✓ |
link.html gzip | 569 B | 569 B | ✓ |
withRouter.html gzip | 557 B | 557 B | ✓ |
Overall change | 1.69 kB | 1.69 kB | ✓ |
Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
buildDuration | 20.8s | 19s | -1.8s |
buildDurationCached | 7.2s | 5.9s | -1.3s |
nodeModulesSize | 46.6 MB | 46.7 MB |
Client Bundles (main, webpack, commons)
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
framework-HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
main-HASH.js gzip | 19.4 kB | 19.4 kB | ✓ |
webpack-HASH.js gzip | 994 B | 994 B | ✓ |
Overall change | 59.7 kB | 59.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
_app-HASH.js gzip | 1.02 kB | 1.02 kB | ✓ |
_error-HASH.js gzip | 3.06 kB | 3.06 kB | ✓ |
amp-HASH.js gzip | 526 B | 526 B | ✓ |
css-HASH.js gzip | 334 B | 334 B | ✓ |
hooks-HASH.js gzip | 890 B | 890 B | ✓ |
index-HASH.js gzip | 262 B | 262 B | ✓ |
link-HASH.js gzip | 1.65 kB | 1.65 kB | ✓ |
routerDirect..HASH.js gzip | 331 B | 331 B | ✓ |
withRouter-HASH.js gzip | 329 B | 329 B | ✓ |
bb14e60e810b..30f.css gzip | 125 B | 125 B | ✓ |
Overall change | 8.54 kB | 8.54 kB | ✓ |
Client Build Manifests
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
_buildManifest.js gzip | 390 B | 390 B | ✓ |
Overall change | 390 B | 390 B | ✓ |
Serverless bundles Overall decrease ✓
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
_error.js | 1.34 MB | 16.9 kB | -1.33 MB |
404.html | 2.42 kB | 2.42 kB | ✓ |
500.html | 2.41 kB | 2.41 kB | ✓ |
amp.amp.html | 10.8 kB | 10.8 kB | ✓ |
amp.html | 1.61 kB | 1.61 kB | ✓ |
css.html | 1.79 kB | 1.79 kB | ✓ |
hooks.html | 1.67 kB | 1.67 kB | ✓ |
index.js | 1.34 MB | 17.2 kB | -1.33 MB |
link.js | 1.4 MB | 17.4 kB | -1.39 MB |
routerDirect.js | 1.4 MB | 17.4 kB | -1.38 MB |
withRouter.js | 1.4 MB | 17.4 kB | -1.38 MB |
Overall change | 6.91 MB | 107 kB | -6.8 MB |
Webpack 4 Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
buildDuration | 13.6s | 14.3s | |
buildDurationCached | 5.8s | 5.8s | |
nodeModulesSize | 46.6 MB | 46.7 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.874 | 2.831 | -0.04 |
/ avg req/sec | 869.87 | 883.24 | +13.37 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.688 | 1.584 | -0.1 |
/error-in-render avg req/sec | 1481.43 | 1577.8 | +96.37 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
677f882d2ed8..HASH.js gzip | 13.3 kB | 13.3 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-HASH.js gzip | 7.26 kB | 7.26 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
Overall change | 60.3 kB | 60.3 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
_app-HASH.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-HASH.js gzip | 3.74 kB | 3.74 kB | ✓ |
amp-HASH.js gzip | 536 B | 536 B | ✓ |
css-HASH.js gzip | 339 B | 339 B | ✓ |
hooks-HASH.js gzip | 887 B | 887 B | ✓ |
index-HASH.js gzip | 227 B | 227 B | ✓ |
link-HASH.js gzip | 1.64 kB | 1.64 kB | ✓ |
routerDirect..HASH.js gzip | 303 B | 303 B | ✓ |
withRouter-HASH.js gzip | 302 B | 302 B | ✓ |
e025d2764813..52f.css gzip | 125 B | 125 B | ✓ |
Overall change | 9.38 kB | 9.38 kB | ✓ |
Client Build Manifests
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
_buildManifest.js gzip | 420 B | 420 B | ✓ |
Overall change | 420 B | 420 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | vercel/next.js perf/static-check-avoid-main | Change | |
---|---|---|---|
index.html gzip | 614 B | 614 B | ✓ |
link.html gzip | 620 B | 620 B | ✓ |
withRouter.html gzip | 606 B | 606 B | ✓ |
Overall change | 1.84 kB | 1.84 kB | ✓ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to land now 👍
### move all access to built pages into worker pool to allow parallelizing and avoid loading the bundles in the main thread This improves performance of the static check step a bit and helps reducing memory load in main thread ### enable splitChunks for server build in webpack 5 This improves performance for static generation by loading less code due to reduced duplication
move all access to built pages into worker pool
to allow parallelizing and avoid loading the bundles in the main thread
This improves performance of the static check step a bit and helps reducing memory load in main thread
enable splitChunks for server build in webpack 5
This improves performance for static generation by loading less code due to reduced duplication