Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(es/minifier): Skip complex inline operations if possible #9972

Merged
merged 4 commits into from
Jan 29, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
only required
kdy1 committed Jan 29, 2025
commit cd42a5e023027542cb80ba4d2964da012d5eab8d
4 changes: 2 additions & 2 deletions crates/swc_ecma_minifier/src/compress/optimize/inline.rs
Original file line number Diff line number Diff line change
@@ -656,8 +656,6 @@ impl Optimizer<'_> {
// Inline very simple functions.
match decl {
Decl::Fn(f) if self.options.inline >= 2 && f.ident.sym != *"arguments" => {
self.vars.inline_with_multi_replacer(&mut f.function.body);

if let Some(body) = &f.function.body {
if !usage.used_recursively
// only callees can be inlined multiple times
@@ -683,6 +681,8 @@ impl Optimizer<'_> {
f.ident.ctxt
);

self.vars.inline_with_multi_replacer(&mut f.function.body);

for i in collect_infects_from(
&f.function,
AliasConfig::default()