-
Notifications
You must be signed in to change notification settings - Fork 3k
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
When extracting a wheel, do not recheck parent directories #12782
Conversation
FYI, the Windows CI failings are unrelated to your PR |
Hi, just a heads up that we just cut pip v24.1 so the core team's resources are being focused on making sure that release is handled smoothly. This PR looks simple so I'll try to take look tomorrow, but in the meanwhile, could you add a NEWS entry? Thank you! |
ead576d
to
7dcb122
Compare
Thanks, I added a NEWS entry. |
Builds is failing after rerunning, there are issues with windows builds and 3.13?
|
9c25b2e
to
0a3b119
Compare
0a3b119
to
dd8f7a5
Compare
All green, should be good to merge now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This modifies the contract between ZipBackedFile.save()
and its caller, but it seems fine. Perhaps a comment explaining that this logic has been moved out for performance reasons would be helpful.
Thanks again for the PR!
Co-authored-by: Richard Si <[email protected]>
this PR is ready to merge |
I'm going to schedule this PR for 24.2 as it seems like a small low-risk performance tweak. Feel free to remove the PR from the milestone if you object. |
Thanks @morotti! ^.^ |
Thank you very much @pradyunsg |
Hello,
Can i offer you a patch to make pip install ~5% faster?
Counting 5% faster in average. Closer to 10% faster on slow disks or network volumes, closer to 1% faster on fast SSD.
The fix is pretty trivial. When extracting a wheel, do not recheck/recreate the parent directory before extracting each file.
Profiling a run of
pip install plotly --prefix ./testdir
PROFILER ON MASTER:
PROFILER WITH THIS FIX:
Notice the 14425 calls to ensure_dir() taking 512ms total or ~5% of the runtime.
Notice it's a lot less with the fix.
Total runtime 10.268 -> 9.414 seconds, thanks to all the calls removed + a few hundreds of ms of variance between pip runs.
Regards.