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

refactor(transformer): break up RegExp transform into multiple functions #5511

Conversation

overlookmotel
Copy link
Collaborator

@overlookmotel overlookmotel commented Sep 5, 2024

Experiment. Idea is to split up the transform, with the heavy logic in separate functions, so potentially the compiler can inline the smaller "entry" functions.

enter_expression is now tiny, and transform_regexp also quite short as it's all simple comparisons. transform_regexp contains all the logic for bailing out quickly, so potentially the fast path for doing nothing could all get inlined.

@github-actions github-actions bot added the A-transformer Area - Transformer / Transpiler label Sep 5, 2024
Copy link
Collaborator Author

overlookmotel commented Sep 5, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @overlookmotel and the rest of your teammates on Graphite Graphite

Copy link

codspeed-hq bot commented Sep 5, 2024

CodSpeed Performance Report

Merging #5511 will not alter performance

Comparing 09-05-refactor_transformer_break_up_regexp_transform_into_multiple_functions (d2829e3) with 09-05-fix_transformer_regexp_transform_only_set_span_on_final_expression (d1c9770)

Summary

✅ 29 untouched benchmarks

@overlookmotel
Copy link
Collaborator Author

Well that doesn't work!

bench

@overlookmotel
Copy link
Collaborator Author

overlookmotel commented Sep 5, 2024

My more minimal version which only moves all the logic into a separate function from enter_expression also does not produce any notable benchmark gain.

A failed experiment!

@overlookmotel overlookmotel deleted the 09-05-refactor_transformer_break_up_regexp_transform_into_multiple_functions branch September 5, 2024 20:47
@overlookmotel overlookmotel restored the 09-05-refactor_transformer_break_up_regexp_transform_into_multiple_functions branch September 6, 2024 08:47
@overlookmotel overlookmotel reopened this Sep 6, 2024
@overlookmotel overlookmotel deleted the 09-05-refactor_transformer_break_up_regexp_transform_into_multiple_functions branch September 6, 2024 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-transformer Area - Transformer / Transpiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant