-
-
Notifications
You must be signed in to change notification settings - Fork 524
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
feat(mangler): mangle private class names #9279
base: main
Are you sure you want to change the base?
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
bb4d1c9
to
abf1825
Compare
10699ae
to
abe1153
Compare
abf1825
to
1770de5
Compare
CodSpeed Performance ReportMerging #9279 will degrade performances by 88.4%Comparing Summary
Benchmarks breakdown
|
9bad165
to
e723e14
Compare
This adds an additional AST pass, but how come it's not shown on the benchmark 🤔 ? |
so i implemented this inside: oxc/crates/oxc_minifier/src/lib.rs Line 48 in 82c354a
minifier::build . but that fn doesn't run when doing the benches. we run the mangler/minifier explicitly.
i think i could either:
|
Yeah this seems better. We can also add a flag (turned off by default) to enable this. |
e723e14
to
71b8928
Compare
runner.run(|| { | ||
let _ = Mangler::new().build_with_semantic(semantic, &program); | ||
let _ = Mangler::new() | ||
.with_options(MangleOptions { | ||
debug: false, | ||
top_level: true, | ||
mangle_private_class_names: true, | ||
}) | ||
.build(&allocator, &mut program); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will regress perf a lot as we are now building semantic inside mangler (inside runner.run
, rather than in the prior phase)
I had to make this change because semantic requires a reference to the Program
, but we need to pass a mutable reference into here for the private class members to mutate the AST.
i'm open to other ideas:
- we could have dedicted methods for mangling symbols vs private class members, and a
.finish
returning the symbol table - something else?
No diff on cargo misize. looks like non of the test suite has classes with private class members