Skip to content

[3.11] gh-93910: Fix enum performance regression (GH-94614) - #94655

Merged
miss-islington merged 1 commit into
python:3.11from
miss-islington:backport-ed136b9-3.11
Jul 7, 2022
Merged

miss-islington merged 1 commit into
python:3.11from
miss-islington:backport-ed136b9-3.11

Conversation

@miss-islington

@miss-islington miss-islington commented Jul 7, 2022 •

Copy link
Copy Markdown
Contributor

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:

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 mdboom@gmail.com

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 <mdboom@gmail.com>
@miss-islington

Copy link
Copy Markdown
Contributor Author

Status check is done, and it's a success ✅ .

@miss-islington

Copy link
Copy Markdown
Contributor Author

Status check is done, and it's a success ✅ .

@miss-islington
miss-islington merged commit 65c4316 into python:3.11 Jul 7, 2022
@miss-islington
miss-islington deleted the backport-ed136b9-3.11 branch July 7, 2022 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants