-
-
Notifications
You must be signed in to change notification settings - Fork 720
refactor(minfier): single match expression #13000
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
refactor(minfier): single match expression #13000
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. |
a828c92 to
1ecabde
Compare
CodSpeed Instrumentation Performance ReportMerging #13000 will improve performances by 13.97%Comparing Summary
Benchmarks breakdown
|
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.
Pull Request Overview
This PR refactors the peephole optimizer's exit expression handling by eliminating individual exit expression methods in favor of a single consolidated match expression. The changes move from separate method calls per optimization type to a unified approach where all optimizations are applied within one comprehensive match statement.
Key changes:
- Removes individual
*_exit_expressionmethods and consolidates logic into mainexit_expressionmatch - Makes previously private optimization methods public for direct usage
- Renames some methods for consistency (e.g.,
fold_call_expressioninstead ofremove_call_expression)
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| substitute_alternate_syntax.rs | Removes substitute_exit_expression method and makes optimization methods public |
| replace_known_methods.rs | Removes replace_known_methods_exit_expression and makes methods public |
| remove_unused_expression.rs | Renames fold_call_expression to remove_unused_call_expression |
| remove_dead_code.rs | Removes remove_dead_code_exit_expression and makes methods public |
| mod.rs | Consolidates all optimization calls into single match expression in exit_expression |
| minimize_statements.rs | Updates method calls to use new consolidated approach |
| minimize_conditions.rs | Removes minimize_conditions_exit_expression and makes methods public |
| fold_constants.rs | Removes fold_constants_exit_expression and makes methods public |
|
Oh wow look at that perf! @sapphi-red I believe this makes things easier to debug, but harder to get the function call ordering right. I'll rewrite the method names and a documentation to make sure the orderings are consistent, in a follow up PR. |
|
Wow! |
Merge activity
|
1ecabde to
ca91a26
Compare
No description provided.