Unverified Commit 15942fcc authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

perf(turbopack): Drop AST node before generating source maps (#79219)

### What?

Source map generation uses lots of memory, so drop another memory hog before performing it.

For `minify()`, we were already doing it, although it seems unintentional.

### Why?

x-ref: Numbers in https://vercel.slack.com/archives/C06PPGZ0FD3/p1747245989125859?thread_ts=1746834549.272939&cid=C06PPGZ0FD3
parent 141e794f
......@@ -1123,6 +1123,8 @@ async fn emit_content(content: CodeGenResult) -> Result<Vc<EcmascriptModuleConte
};
emitter.emit_program(&program)?;
// Drop the AST eagerly so we don't keep it in memory while generating source maps
drop(program);
}
let source_map = if generate_source_map {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment