perf(minifier): process newly created stmt in handle_if_statement (#26541)

After creation new expression if/expression, we will now directly pass
it though `minimize_statement`, instead of waiting for next full pass
This commit is contained in:
Armano authored and GitHub committed 2026-09-11 08:47:45 +08:00
1 parent d21d5cf32f
commit c78d7074f8
2 files changed
+8 -8

No files matched your search

@@ -619,8 +619,8 @@ impl<'a> PeepholeOptimizations {
Self::try_minimize_if(&mut if_stmt, ctx).unwrap_or_else(|| {
Statement::IfStatement(ArenaBox::new_in(if_stmt, ctx))
});
result.push(if_stmt);
ctx.notice_change();
Self::minimize_statement(if_stmt, stmts, result, ctx);
return;
}
}
@@ -1,13 +1,13 @@
checker.ts:
file size: 2922154 # 2.92 MB
sys allocs: 150
sys allocs: 122
sys reallocs: 5
sys deallocs: 150
sys deallocs: 122
sys alloc bytes: 14996632 # 15.00 MB
sys peak growth: 10169560 # 10.17 MB
arena allocs: 72024
arena reallocs: 28269
arena size: 17401952 # 17.40 MB
arena allocs: 59908
arena reallocs: 21415
arena size: 16569784 # 16.57 MB
App.tsx:
file size: 415342 # 415.34 kB
@@ -71,6 +71,6 @@ kitchen-sink.tsx:
sys deallocs: 1854
sys alloc bytes: 5304692 # 5.30 MB
sys peak growth: 3707457 # 3.71 MB
arena allocs: 31992
arena reallocs: 12187
arena allocs: 31993
arena reallocs: 12186
arena size: 8689832 # 8.69 MB