bpo-43392: Optimize repeated calls to __import__()#24735
Conversation
30cde89 to
1fe2c94
Compare
|
This PR is stale because it has been open for 30 days with no activity. |
pitrou
left a comment
There was a problem hiding this comment.
The optimization looks reasonable in the principle, as there's already a similar one on the C side.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
@Kronuz if this is ready for review again then please see the instructions at #24735 (comment) on how to request a re-review. |
|
Oh! @brettcannon, yes I have made the requested changes; please review again. I just missed that part of the instructions. |
|
Thanks for making the requested changes! @pitrou: please review the changes made to this pull request. |
|
Didn't close it... reopening 🤪 |
|
@pitrou, I've addressed the suggestions and made the changes, however I'm not sure if I'm doing something wrong or why this doesn't show as all green and instead has 2 workflows awaiting approval and the "Changes requested" status. Please let me know if I'm missing something. |
|
@Kronuz You just had to post the phrase "I have made the requested changes; please review again" as mentioned by the bot above :) As for the CI steps, they must be approved by a core developer since this is your first PR. |
|
@pablogsal @iritkatriel Do you want to take a look at this? |
brettcannon
left a comment
There was a problem hiding this comment.
Minor comment tweaks, but the PR doesn't allow for modification by me so I can't fix them.
Otherwise importlib.h is out-of-date. Let's give people a week to add any review they may want, otherwise I will merge this once importlib.h is no longer a merge conflict.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Implements a two steps check in `importlib._bootstrap._find_and_load()` to avoid locking when the module has been already imported and it's ready.
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @pitrou, @brettcannon: please review the changes made to this pull request. |
Implements a two steps check in
importlib._bootstrap._find_and_load()to avoid locking when the module has been already imported and it's ready.Using
importlib.__import__(), after this, does show a big difference:Before:
After:
https://bugs.python.org/issue43392
Automerge-Triggered-By: GH:pitrou