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

perf(traverse): faster TraverseScoping::is_static #7746

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Dec 9, 2024

Speed up TraverseScoping::is_static by checking if symbol is const. That check is faster than iterating through all references to see if they write to the binding.

This also subtly changes behavior. is_static(x) will now return true for x in const x = 1; x = 2;. But that's valid, because the purpose of is_static is to say whether the value of the var can be mutated, which it can't if it's const.

Copy link

graphite-app bot commented Dec 9, 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.

Copy link
Contributor Author

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

@github-actions github-actions bot added the C-performance Category - Solution not expected to change functional behavior, only performance label Dec 9, 2024
@overlookmotel overlookmotel marked this pull request as ready for review December 9, 2024 16:01
Copy link

codspeed-hq bot commented Dec 9, 2024

CodSpeed Performance Report

Merging #7746 will not alter performance

Comparing 12-09-perf_traverse_faster_traversescoping_is_static_ (9a5ca7b) with main (463fc5f)

Summary

✅ 29 untouched benchmarks

@overlookmotel
Copy link
Contributor Author

0.1% perf boost. Woo hoo!

@overlookmotel
Copy link
Contributor Author

Actually, I'm refactoring things. This method can be deleted entirely. I'll do that in another PR.

@overlookmotel overlookmotel deleted the 12-09-perf_traverse_faster_traversescoping_is_static_ branch December 9, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-performance Category - Solution not expected to change functional behavior, only performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants