Skip to content

gh-98701: Constant folding of unpacking in sets #98702

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

Closed

Conversation

thatbirdguythatuknownot
Copy link
Contributor

@thatbirdguythatuknownot thatbirdguythatuknownot commented Oct 26, 2022

Add fold_set for folding constant unpacking in sets where the length of the constant is 0 or 1.

@AlexWaygood AlexWaygood added the performance Performance or resource usage label Oct 26, 2022
@hauntsaninja
Copy link
Contributor

hauntsaninja commented Oct 26, 2022

I think this PR gets the same feedback as you got in #96940
a) the PR is missing unit tests,
b) is this optimisation worth doing? does this code show up in real programs?

@thatbirdguythatuknownot
Copy link
Contributor Author

I think this PR gets the same feedback as you got in #96940 a) the PR is missing unit tests, b) is this optimisation worth doing? does this code show up in real programs?

b) https://stackoverflow.com/questions/6130374/empty-set-literal
It seems like this has been visited upon a lot of times already. I'm not sure about having a non-empty unpack though.

@thatbirdguythatuknownot
Copy link
Contributor Author

Closed as per the disapproval of #98701.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review performance Performance or resource usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants