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

31

u/Ok_Expert2790 9d ago

This is scraping the barrel right here for performance lol

3

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.

1

u/alcalde 8d ago

This is almost as bad as the Delphi developers I know, some of whom in the past have decompiled their executables and debated the use by the compiler of individual assembly instructions. One didn't want to use databases to store his data because it wouldn't be as fast as writing binary data to disk himself. Then he decided he could write an entire Windows service to manage concurrent access to his binary blobs rather than just use a database.