-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
--use-pep517 appears to be significanly slower for small projects #10060
Comments
This is probably caused by build isolation (which is used in PEP 517 builds but not in the "legacy" code path, if I remember correctly). Does performance improve if you use (Please understand that I'm asking for diagnosis purposes - you most definitely should not recommend using |
Adding
Is this expected? |
Yes. When building using PEP 517/518, the build requirements (which are usually specified in While it would be nice to avoid the cost of setting up a build environment when it's not needed, it's frankly not been a significant issue for anyone until this point, and it would be hard to do so reliably. The legacy build process did none of this - it just tried the build in the environment the project was being installed into, and if that failed, tough. Of course, for simpler projects like your example, this worked fine. But for more complex projects it was an issue. |
And we do want to improve in this area -- there's other issues tracking that (like #7294). |
A recent pip/setuptools update made pep517 isolated builds the default. That's really good and I would like to use it but also it makes the builds incredibly slow: pypa/pip#10060 We need to keep pep517 because it's what allows pyproject tomls to specify build deps, but by preinstalling those build deps and turning off build isolation we can make it fast again. This isn't a good general purpose solution and it will surely break at some point when we add some new package but we can cross that bridge when we come to it
Description
I have observed a performance regression in building wheels with
--use-pep517
vs--no-use-pep517
Expected behavior
No significant performance change between
--use-pep517
and--no-use-pep517
pip version
21.1.2
Python version
3.7.3
OS
Debian
How to Reproduce
To reproduce:
git clone [email protected]:zmanji/git-squash.git
e714352b532f2fdfc57b23df9b7cf8dc0fed34d6
Run
Observe that the only difference between to the two
pip wheel
commands is--no-use-pep517
vs--use-pep517
. Also observe the in tree build feature is enabled.Feel free to change
-w2
to-w3
or higher to increase warmupsOutput
With
pip
21.1.2
andwheel
0.36.2
I see the following results
on macOS 11.4 with Python
3.9.4
on Debian Linux with Python
3.7.3
I know it is a small project so this might be an extreme case, but this appears to be unexpected.
Code of Conduct
The text was updated successfully, but these errors were encountered: