Skip to content

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

Merged
ichard26 merged 1 commit intopypa:mainfrom
ichard26:no-compile
Feb 9, 2025
Merged

perf: pass --no-compile for build dependencies#13192
ichard26 merged 1 commit intopypa:mainfrom
ichard26:no-compile

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
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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 25, 2025
@ichard26 ichard26 deleted the no-compile branch March 8, 2025 04:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants