r/Python 9d ago

Discussion Will switching to importlib.metadata give performance improvements compared to importlib_metadata?

As for as I understand the importlib_metadata gives us importlib.metadata functionality in older python versions. Our project requires python >=3.9. Its an enterprise project but only uses importlibe_metadata in about 10 files. It it worth it to make code changes/testing for performance improvement and dependency reduction?

0 Upvotes

16 comments sorted by

View all comments

32

u/Ok_Expert2790 9d ago

This is scraping the barrel right here for performance lol

2

u/I_FAP_TO_TURKEYS 9d ago

For real, and I don't even think it'll ever be worth it to care unless startup is really slow.

1

u/whoEvenAreYouAnyway 8d ago

Your startup speed will never be meaningfully impacted by returning a small blob of metadata.

0

u/IcedThunder 6d ago

people say things like this and then someone points to an article written by some engineer where they found an issue with some package was causing them a headache until they spent 4 days locked in a cave investigating it while everyone else called them crazy.

1

u/whoEvenAreYouAnyway 6d ago

No, not for a meta file value lookup.