Skip to content
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

perf: pass --no-compile for build dependencies #13192

Merged
merged 1 commit into from
Feb 9, 2025

Conversation

ichard26
Copy link
Member

@ichard26 ichard26 commented Jan 29, 2025

As the build environment is ephemeral, it's wasteful to pre-compile everything, especially as not every Python module will be used/compiled in most cases. In addition, the argument is that compilation ensures read-only installations are not slower than necessary is moot as the build environment is by design writable.

This saves ~200ms while installing setuptools while building pip itself. For context, a pip install . (with --no-index and --find-links) takes 3400ms and pip wheel . takes 2200ms on main.

So, it's not a major win, but it's also nothing to sneeze at. Packages using smaller backends, like flit, will likely see smaller improvements.

Towards #7294


To try this out for yourself, you can use --no-index --find-links tests/data/common_wheels/ to pull setuptools from disk and eliminate the network as variable.

@ichard26
Copy link
Member Author

Build has been passing --no-compile for modest, but noticeable gains for a while: pypa/build#752.

@ichard26 ichard26 added this to the 25.1 milestone Jan 29, 2025
news/7294.feature.rst Outdated Show resolved Hide resolved
news/7294.feature.rst Outdated Show resolved Hide resolved
As the build environment is ephemeral, it's wasteful to pre-compile
everything, especially as not every Python module will be used/compiled
in most cases. In addition, the argument is that compilation ensures
read-only installations are not slower than necessary is moot as the
build environment is by design writable.

This saves ~200ms while installing setuptools while building pip itself.
For context, a pip install . (with --no-index and --find-links) takes
3400ms on main and pip wheel . takes 2200ms on main.

So, it's not a major win, but it's also nothing to sneeze at. Packages
using smaller backends, like flit, will likely see smaller improvements.
@ichard26
Copy link
Member Author

ichard26 commented Feb 9, 2025

Thanks for the reviews folks!

@ichard26 ichard26 merged commit 3994c61 into pypa:main Feb 9, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants