next.js
d54d43d4 - Use only 1 worker for type checking and linting (#45639)

Commit
2 years ago
Use only 1 worker for type checking and linting (#45639) During build, there's no need to start N workers for type checking and linting, because there's no concurrency at all for these tasks (both TypeScript and ESLint are checking all files globally). During my test of `next build` for a small size project of 5 pages, this change reduces the peak memory usage by 545MB (as each worker holds a huge dependency chain). Before (there are too many worker threads initiated): <img width="1278" alt="before" src="https://user-images.githubusercontent.com/3676859/217116925-5594a45c-f1bb-4d11-8699-f6fe12ce7ee5.png"> After: <img width="1189" alt="CleanShot-2023-02-07-WfQTnB1D@2x" src="https://user-images.githubusercontent.com/3676859/217116940-a08a256e-b80d-4836-8b97-2837c845435e.png"> It improves the CPU usage as well. In the future we can spin up multiple workers and assign sub-task for each, but that only makes sense when the number of pages is large. NEXT-470
Author
Parents
Loading