-
-
Notifications
You must be signed in to change notification settings - Fork 475
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
transformer: performance regression from generated_uid
#5488
Labels
A-transformer
Area - Transformer / Transpiler
C-bug
Category - Bug
C-performance
Category - Solution not expected to change functional behavior, only performance
Comments
Do you suspect this is the root cause of #5457? |
Nope, I just checked Giving it a spin anyway: #5489 |
⚡ | transformer[pdf.mjs] | 10.6 ms | 7.4 ms | +43.59% |
Boshen
added
A-transformer
Area - Transformer / Transpiler
C-performance
Category - Solution not expected to change functional behavior, only performance
labels
Sep 5, 2024
Boshen
changed the title
transformer: insane performance regression from
transformer: performance regression from Sep 7, 2024
generated_uid
generated_uid
Boshen
pushed a commit
that referenced
this issue
Sep 10, 2024
Close #5488. `generate_uid` previously iterated through every symbol and unresolved reference in the AST to find a unique var name. If the first var name it tried was already in use, it'd iterate again. Instead build a hash map recording existing var names in use for every name which could clash with a UID (any var name starting with `_`). Once built, use that hash map to generate UIDs without iterating through all symbols again. I had hoped to make `generate_uid` cheaper still by just recording the highest digits postfix for each var name, and then incrementing that postfix for each UID. i.e. if AST contains vars `_foo1` and `_foo6`, create UIDs starting at one number higher - `_foo7`, `_foo8` etc. This method would be more efficient, but unfortunately it does not match Babel, and so causes some of Babel's tests to fail.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-transformer
Area - Transformer / Transpiler
C-bug
Category - Bug
C-performance
Category - Solution not expected to change functional behavior, only performance
It's inside
OptionalCatchBinding
->enter_catch_clause
.The text was updated successfully, but these errors were encountered: