-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
gh-93910: Fix enum performance regression #94614
Conversation
This removes the performance regression in 3.11, at the expense of not fixing the "bug" that allows accessing values from values (e.g. `Color.RED.BLUE`).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, excellent work!
I skimmed the docs and could not find a whatsnew or versionchanged entry that mentions the new and now removed behavior.
Co-authored-by: Christian Heimes <[email protected]>
Could you please add blurb that mentions the performance regression and the fact that member of member access is permitted again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment formatting change to make, otherwise LGTM.
Co-authored-by: Brett Cannon <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for fixing this release blocker!
@ethanfurman Are you ok with the change for 3.11? |
Thanks @mdboom for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
This removes the performance regression in 3.11, **at the expense of not fixing the "bug" that allows accessing values from values** (e.g. `Color.RED.BLUE`). Using the benchmark @markshannon [presented](https://github.com/python/cpython/issues/93910GH-issuecomment-1165503032), the results are: | Version | Enum | Fast enum | Normal class | | --- | --- | --- | --- | | 3.10 | 2.04 | 0.59 | 0.56 | | 3.11 | 2.78 | 0.31 | 0.15 | | This PR | 1.30 | 0.32 | 0.16 | I share this mostly as information about the source of the regression, as this may be useful. It may be that the lower-risk approach for the beta is just to revert to a previously-known working state. (cherry picked from commit ed136b9) Co-authored-by: Michael Droettboom <[email protected]>
GH-94655 is a backport of this pull request to the 3.11 branch. |
This removes the performance regression in 3.11, **at the expense of not fixing the "bug" that allows accessing values from values** (e.g. `Color.RED.BLUE`). Using the benchmark @markshannon [presented](https://github.com/python/cpython/issues/93910GH-issuecomment-1165503032), the results are: | Version | Enum | Fast enum | Normal class | | --- | --- | --- | --- | | 3.10 | 2.04 | 0.59 | 0.56 | | 3.11 | 2.78 | 0.31 | 0.15 | | This PR | 1.30 | 0.32 | 0.16 | I share this mostly as information about the source of the regression, as this may be useful. It may be that the lower-risk approach for the beta is just to revert to a previously-known working state. (cherry picked from commit ed136b9) Co-authored-by: Michael Droettboom <[email protected]>
This removes the performance regression in 3.11, at the expense of not fixing
the "bug" that allows accessing values from values (e.g.
Color.RED.BLUE
).Using the benchmark @markshannon presented, the results are:
I share this mostly as information about the source of the regression, as this may be useful. It may be that the lower-risk approach for the beta is just to revert to a previously-known working state.
Automerge-Triggered-By: GH:tiran