Page MenuHomePhabricator

improve BuiltinEnum.contains
ClosedPublic

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

Details

Summary

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

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

Event Timeline

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