next.js
5b224854 - Limit build workers to pages+1 (#90475)

Commit
2 days ago
Limit build workers to pages+1 (#90475) During build time, we spawn a pool of workers for static page generation. The size is `max(4, NUM_CORES - 1)`. With smaller sites, this ends up with far more workers than pages. This tries to cap the number of workers we actually spin up to something more appropriate for the number of pages. This change saved 90ms on an app with fewer static pages, on a 10-core Macbook. After this change, the behavior will be: - If you have 16 cores and 4 pages, we start 5 workers - If you have 8 cores and 100 pages, we start 7 workers
Author
Parents
Loading