[issue38659] enum classes cause slow startup time

2021-10-12 Thread Ethan Furman
Ethan Furman added the comment: The reason for that quadratic behavior is that for each new member (aka attribute), all the previous members must be checked to see if the new member is a duplicate. In practice I wouldn't expect this to be a problem as most enums should be fairly small --

[issue38659] enum classes cause slow startup time

2021-10-08 Thread Armin Rigo
Armin Rigo added the comment: Nobody seemed to mention it so I might as well: defining a regular Enum class takes an amount of time that is clearly quadratic in the number of attributes. That means that the problem is not Python-versus-C or small speed-ups or adding secret APIs to do the

[issue38659] enum classes cause slow startup time

2021-04-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Seems that the buildbots are going back to green so I will close the revert PR. THanks a lot, Ethan for the fix and the investigation! -- ___ Python tracker

[issue38659] enum classes cause slow startup time

2021-04-24 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue38659] enum classes cause slow startup time

2021-04-24 Thread Ethan Furman
Ethan Furman added the comment: Pablo, did my latest patch resolved the errors? -- ___ Python tracker ___ ___ Python-bugs-list

[issue38659] enum classes cause slow startup time

2021-04-23 Thread Ethan Furman
Ethan Furman added the comment: New changeset 6c681e1a4aa2dbca61be9a26c9257d7d25fa29a7 by Ethan Furman in branch 'master': bpo-38659: [Enum] do not check '_inverted_' during simple test (GH-25566) https://github.com/python/cpython/commit/6c681e1a4aa2dbca61be9a26c9257d7d25fa29a7 --

[issue38659] enum classes cause slow startup time

2021-04-23 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +24285 pull_request: https://github.com/python/cpython/pull/25566 ___ Python tracker ___

[issue38659] enum classes cause slow startup time

2021-04-23 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Thanks a lot Ethan. I will wait then for the investigation. -- ___ Python tracker ___ ___

[issue38659] enum classes cause slow startup time

2021-04-23 Thread Ethan Furman
Ethan Furman added the comment: My apologies, I was having hardware issues. Checking it out now. -- ___ Python tracker ___ ___

[issue38659] enum classes cause slow startup time

2021-04-23 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Unfortunately, I am being forced to revert commit a02cb474f9c097c83cd444a47e9fb5f99b4aaf45 due to have it failing of all refleak buildbots for more than two days. -- ___ Python tracker

[issue38659] enum classes cause slow startup time

2021-04-23 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +24279 pull_request: https://github.com/python/cpython/pull/25560 ___ Python tracker ___

[issue38659] enum classes cause slow startup time

2021-04-23 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Commenting out the enum tests reveals that test_socket has additional problems: ㋹ ./python.exe -m test test_socket -R 3:3 0:00:00 load avg: 2.32 Run tests sequentially 0:00:00 load avg: 2.32 [1/1] test_socket beginning 6 repetitions 123456

[issue38659] enum classes cause slow startup time

2021-04-23 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Gentle ping -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38659] enum classes cause slow startup time

2021-04-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Thanks Ammar for the fix. Unfortunately there is still some failures related to this on test_socker: == ERROR: test_msgflag_enum (test.test_socket.GeneralModuleTests)

[issue38659] enum classes cause slow startup time

2021-04-22 Thread STINNER Victor
STINNER Victor added the comment: def setUp(self): # Reset the module-level test variables to their original integer # values, otherwise the already created enum values get converted # instead. Why not doing that in a tearDown() method instead? What if you run

[issue38659] enum classes cause slow startup time

2021-04-21 Thread Ethan Furman
Ethan Furman added the comment: Actually, I think that fixed the refleak issue as well. Thanks, Ammar! -- ___ Python tracker ___

[issue38659] enum classes cause slow startup time

2021-04-21 Thread Ethan Furman
Ethan Furman added the comment: New changeset 37b173c5231b7b202859af97c17bc3d04b1e4c75 by Ammar Askar in branch 'master': bpo-38659: Properly re-intialize module variables in test_enum (GH-25516) https://github.com/python/cpython/commit/37b173c5231b7b202859af97c17bc3d04b1e4c75 --

[issue38659] enum classes cause slow startup time

2021-04-21 Thread Ethan Furman
Ethan Furman added the comment: `format` issue resolved, but not the refleak issue. -- ___ Python tracker ___ ___ Python-bugs-list

[issue38659] enum classes cause slow startup time

2021-04-21 Thread Ammar Askar
Change by Ammar Askar : -- pull_requests: +24234 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25516 ___ Python tracker ___

[issue38659] enum classes cause slow startup time

2021-04-21 Thread Ammar Askar
Ammar Askar added the comment: Looks like this is the issue described in the comment here: https://github.com/python/cpython/blob/master/Lib/test/test_enum.py#L3691-L3692 On the first run you have the correct ('CONVERT_STRING_TEST_NAME_A', 5) but later it turns into

[issue38659] enum classes cause slow startup time

2021-04-21 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Can someone take a look? As per the buildbot policy (https://discuss.python.org/t/policy-to-revert-commits-on-buildbot-failure/404) we may need to revert it if is not fixed in 24 because of the risk of masking errors. --

[issue38659] enum classes cause slow startup time

2021-04-21 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- priority: normal -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue38659] enum classes cause slow startup time

2021-04-21 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Commit a02cb474f9c097c83cd444a47e9fb5f99b4aaf45 fails to build in the refleak buildbots: https://buildbot.python.org/all/#/builders/75/builds/2/steps/5/logs/stdio Example failure: ❯ ./python -m test test_enum -R : 0:00:00 load avg: 1.81 Run tests

[issue38659] enum classes cause slow startup time

2021-04-21 Thread Ethan Furman
Change by Ethan Furman : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue38659] enum classes cause slow startup time

2021-04-21 Thread Ethan Furman
Ethan Furman added the comment: New changeset a02cb474f9c097c83cd444a47e9fb5f99b4aaf45 by Ethan Furman in branch 'master': bpo-38659: [Enum] add _simple_enum decorator (GH-25497) https://github.com/python/cpython/commit/a02cb474f9c097c83cd444a47e9fb5f99b4aaf45 --

[issue38659] enum classes cause slow startup time

2021-04-21 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +24219 pull_request: https://github.com/python/cpython/pull/25497 ___ Python tracker ___

[issue38659] enum classes cause slow startup time

2021-04-21 Thread Ethan Furman
Change by Ethan Furman : -- versions: +Python 3.10 -Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue38659] enum classes cause slow startup time

2021-04-19 Thread Ethan Furman
Ethan Furman added the comment: New changeset 503cdc7c124cebbd777008bdf7bd9aa666b25f07 by Ethan Furman in branch 'master': Revert "bpo-38659: [Enum] add _simple_enum decorator (GH-25285)" (GH-25476) https://github.com/python/cpython/commit/503cdc7c124cebbd777008bdf7bd9aa666b25f07

[issue38659] enum classes cause slow startup time

2021-04-19 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +24202 pull_request: https://github.com/python/cpython/pull/25476 ___ Python tracker ___

[issue38659] enum classes cause slow startup time

2021-04-19 Thread Ethan Furman
Ethan Furman added the comment: New changeset dbac8f40e81eb0a29dc833e6409a1abf47467da6 by Ethan Furman in branch 'master': bpo-38659: [Enum] add _simple_enum decorator (GH-25285) https://github.com/python/cpython/commit/dbac8f40e81eb0a29dc833e6409a1abf47467da6 --

[issue38659] enum classes cause slow startup time

2021-04-08 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +24021 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25285 ___ Python tracker

[issue38659] enum classes cause slow startup time

2019-11-01 Thread Ethan Furman
Ethan Furman 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

[issue38659] enum classes cause slow startup time

2019-10-31 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38659] enum classes cause slow startup time

2019-10-31 Thread Gregory P. Smith
New submission from Gregory P. Smith : Creating an enum subclass (ie: defining an enum) is slow. This dramatically impacts startup time of Python programs that import a bunch of potentially needed constant definitions at startup before any proper code executes. How slow? So slow that a