[issue38659] enum classes cause slow startup time

Ethan Furman report at bugs.python.org
Fri Nov 1 09:22:54 EDT 2019


Ethan Furman <ethan at stoneleaf.us> added the comment:

I was just looking at this problem, and creating a bare-bones, no safety belts version for use in the stdlib (no patch yet) which decreases Enum creation from 14x slower to only 6x slower.  (Comparing to a class with simple attributes.)

Not sure if that's enough improvement, though.

If it needs to be even faster, a C version of that simplified Enum shouldn't be too hard.  Anyone that uses the _simple_enum, though, should have a test that uses the full Enum and compares the two to make sure nothing got lost in translation.

----------
assignee:  -> ethan.furman

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38659>
_______________________________________


More information about the Python-bugs-list mailing list