You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0102e2b
Browse filesBrowse the repository at this point in the historyBrowse files
perf(javascript): release the rendered module sources after emit
Reading a chunk asset — what a minimizer or an asset plugin does — flattens
every module factory source the chunk holds, and each memoizes its copy of
that text. The factory sources live in a compiler-lifetime `WeakMap` keyed
by the code generation source, so those copies stayed reachable for as long
as the compilation did.
Each compilation now collects the factory sources it rendered, including
the ones it took from the cache, and releases their flattened copies once
its assets are emitted. Clearing is only a hint, so a later read re-renders.
Retained heap on a 2243-module production build: 149.47 -> 125.87 MiB, and
230.69 -> 181.44 MiB after six watch builds with a memory cache. Emitted
output is byte-identical and no source had to be flattened again.
0 commit comments