-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Big Performance dropdown with middleware, latest nextjs and node version >=16.17.1 #42225
Comments
Any news on this? It is really hurting performance |
I think it's also related to: #42349 |
I also have this issue. One thing that really improved my performance for me was by adding:
The documentation states: Middleware will be invoked for every route in your project. Specifying specific routes seems to improve it greatly. |
Thanks for your response, however I notice the same slow behavior even if I use middleware without any code at all inside the exported function |
Follow-up to #41402 this re-enables the sandbox cache and updates to leverage our global `AsyncLocalStorage` for isolating request meta in both the edge and Node.js runtime. Closes: #42349 Closes: #38235 Closes: #42225 Closes: #42351 ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
The above patch is now available in |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Enterprise LTSC 2021
Binaries:
Node: 16.17.1
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.0.1-canary.2
eslint-config-next: 12.3.1
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
After upgrading to latest next 12 canary or next 13 canary version,I have a huge performance drop (middleware enabled). It is pretty obvious when I load my website but also when I run lighthouse which reports a core of 51 instead of ~97 that i reported before the upgrade. If I either switch to latest next stable release or disable the middleware performance returns to normal levels. The same happens if I downgrade my nodejs version to 16.5.0 and keep the middleware and latest nextjs
related to #41551 , #38273
Expected Behavior
Performance should be kept high regardless nodejs version and middleware usage
Link to reproduction
https://github.com/11koukou/my-app
To Reproduce
Simply clone the project, npm install, npm run build, and npm start. Check out the performance and then disable/delete the "middleware.ts" file , repeat the steps and check the performance again. Without middleware lighthouse reports 100. The same happens if you just downgrade to next version 12.3.1 and keep the middleware enabled, or downgrade to nodejs 16.5.0 and keep the middleware and latest nextjs as well
The text was updated successfully, but these errors were encountered: