Page MenuHomePhabricator

improve BuiltinEnum.contains

Authored by alangenfeld on Nov 5 2019, 7:44 PM.



py-spy revealed that this contains method is suprisingly slow - though not with a granularity that reveals exactly why. Probably comparing with all the dunder methods.

Test Plan

pytest python_modules/dagster-graphql/dagster_graphql_tests/graphql/ & sudo py-spy record --format speedscope --output tests.scope -p $!

See that contains no longer ranks top of the list of self-time

Diff Detail

R1 dagster
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alangenfeld created this revision.Nov 5 2019, 7:44 PM
alangenfeld planned changes to this revision.Nov 5 2019, 7:51 PM
max accepted this revision.Nov 5 2019, 8:21 PM
This revision is now accepted and ready to land.Nov 5 2019, 8:21 PM
This revision was automatically updated to reflect the committed changes.