diff options
author | Michael Droettboom <mdboom@gmail.com> | 2022-07-07 11:26:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-07 11:26:56 (GMT) |
commit | ed136b96737fdbeff864079d12904cb962c6cce5 (patch) | |
tree | f8ec5bc48b2fdf0362d95c8d3f62b7a956d9b2c5 /Misc | |
parent | 277f55cb04409ccdf651d43df5eb9dcb3ee3128c (diff) | |
download | cpython-ed136b96737fdbeff864079d12904cb962c6cce5.zip cpython-ed136b96737fdbeff864079d12904cb962c6cce5.tar.gz cpython-ed136b96737fdbeff864079d12904cb962c6cce5.tar.bz2 |
gh-93910: Fix enum performance regression (GH-94614)
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/93910#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.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2022-07-06-14-45-12.gh-issue-93910.iZcp67.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2022-07-06-14-45-12.gh-issue-93910.iZcp67.rst b/Misc/NEWS.d/next/Library/2022-07-06-14-45-12.gh-issue-93910.iZcp67.rst new file mode 100644 index 0000000..2e58911 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-07-06-14-45-12.gh-issue-93910.iZcp67.rst @@ -0,0 +1,3 @@ +The ability to access the other values of an enum on an enum (e.g. +``Color.RED.BLUE``) has been restored in order to fix a performance +regression. |