-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Further optimize distribution() searching. #272
Conversation
Thanks for this. It's excellent. The only real wish I have (for future consideration) is if these optimizations had been committed and pushed separately, we could see the impact of each change independently. Any idea why the Python 3.6 tests are timing out? |
Oh, dear. I see the Python 3.6 tests have been timing out for some time, although apparently only intermittently. I'll bet it's some bug with pips resolver and selective dependencies on self (importlib_metadata). I'll deal with that in another issue/pr. |
As a consequence, `ext` doesn't include the leading dot anymore, so change `suffixes` accordingly too.
Done. |
Looks like the second and third commits had the most impact:
|
Locally, this speeds up
distribution("ipython")
on a large-ishenvironment by nearly 2-fold. (The GHA benchmark goes from ~1.6ms
to ~0.8ms.)
All the following changes matter for the performance gain:
(See https://gitlab.com/python-devs/importlib_metadata/-/issues/95 for
rationale why performance matters.)