Skip to content

Comments

perf(transformer): reuse same UID for _this in arrow function transform#5840

Closed
overlookmotel wants to merge 1 commit into09-17-feat_traverse_generate_uid_name_methodfrom
09-17-perf_transformer_reuse_same_uid_for__this_in_arrow_function_transform
Closed

perf(transformer): reuse same UID for _this in arrow function transform#5840
overlookmotel wants to merge 1 commit into09-17-feat_traverse_generate_uid_name_methodfrom
09-17-perf_transformer_reuse_same_uid_for__this_in_arrow_function_transform

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Sep 17, 2024

Re-use same _this UID for every scope, instead of creating a new one each time - _this, _this2 etc. It's not necessary for each var to have a different name, as only one this can be in scope anywhere.

Conformance fails because some of Babel's test cases rely on every _this var to be named differently, so we can't merge this, but submitting PR just to see the effect on benchmarks.

@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 17, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 17, 2024

CodSpeed Performance Report

Merging #5840 will not alter performance

Comparing 09-17-perf_transformer_reuse_same_uid_for__this_in_arrow_function_transform (9778a05) with 09-17-feat_traverse_generate_uid_name_method (82e8778)

Summary

✅ 29 untouched benchmarks

@overlookmotel
Copy link
Member Author

Interesting. generate_uid is now cheap enough that this doesn't make any noticeable difference on benchmarks. Or maybe our benchmarks don't include enough arrow functions containing this for the code to be exercised.

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