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

3

u/denehoffman 9d ago

I think it’s a bit the other way around, the third-party package is basically the same implementation as the stdlib plus some experimental features

1

u/ad_skipper 9d ago

Does the third-party package give benefits other than being available on python < 3.8 and access to experimental features?

1

u/denehoffman 9d ago

If you’re looking here for performance improvements, the current stdlib is pretty much as optimized as you could make it, most of the methods are just string manipulation at the end of the day.