mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
00106b7ef4
## What Adds a reworked version of webpack's [built-in memory cache garbage collection plugin](https://github.com/webpack/webpack/blob/853bfda35a0080605c09e1bdeb0103bcb9367a10/lib/cache/MemoryWithGcCachePlugin.js#L15) that is more aggressive in cleaning up unused modules than the default. The default marks 1/5th of the modules as "up for potentially being garbage collected". The new plugin always checks all modules. In my testing this does not cause much overhead compared to the current approach which leverages writing to two separate maps. The change also makes the memory cache eviction more predictable: when an item has not been accessed for 5 compilations it is evicted from the memory cache, it could still be in the disk cache. In order to test this change I had to spin up the benchmarks but these were a bit outdated so I've cleaned up the benchmark applications. --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
15 lines
467 B
JSON
15 lines
467 B
JSON
{
|
|
"name": "bench-rendering",
|
|
"scripts": {
|
|
"build-application": "next build",
|
|
"start": "NODE_ENV=production pnpm build-application && NODE_ENV=production next start",
|
|
"bench:stateless": "ab -c1 -n3000 http://0.0.0.0:3000/stateless",
|
|
"bench:stateless-big": "ab -c1 -n500 http://0.0.0.0:3000/stateless-big",
|
|
"bench:recursive-copy": "node recursive-copy/run"
|
|
},
|
|
"dependencies": {
|
|
"fs-extra": "10.0.0",
|
|
"recursive-copy": "2.0.11"
|
|
}
|
|
}
|