mirror of
https://github.com/pyenv/pyenv.git
synced 2025-02-16 22:02:35 +00:00
Merge pull request #2579 from hauntsaninja/faster-cpython
Mention how to build for maximum performance
This commit is contained in:
commit
894bcd8717
2 changed files with 18 additions and 0 deletions
|
@ -396,6 +396,9 @@ You can pass options to Python's `configure` and compiler flags to customize the
|
||||||
see [_Special environment variables_ in Python-Build's README](plugins/python-build/README.md#special-environment-variables)
|
see [_Special environment variables_ in Python-Build's README](plugins/python-build/README.md#special-environment-variables)
|
||||||
for details.
|
for details.
|
||||||
|
|
||||||
|
**NOTE:** If you'd like a faster interpreter at the cost of longer build times,
|
||||||
|
see [_Building for maximum performance_ in Python-Build's README](plugins/python-build/README.md#building-for-maximum-performance).
|
||||||
|
|
||||||
**NOTE:** If you want to use proxy for download, please set the `http_proxy` and `https_proxy`
|
**NOTE:** If you want to use proxy for download, please set the `http_proxy` and `https_proxy`
|
||||||
environment variables.
|
environment variables.
|
||||||
|
|
||||||
|
|
|
@ -164,6 +164,21 @@ the version(s) installed with `--enable-shared`.
|
||||||
$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 2.7.9
|
$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 2.7.9
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Building for maximum performance
|
||||||
|
|
||||||
|
Building CPython with `--enable-optimizations` will result in a faster
|
||||||
|
interpreter at the cost of significantly longer build times. Most notably, this
|
||||||
|
enables PGO (profile guided optimization). While your mileage may vary, it is
|
||||||
|
common for performance improvement from this to be in the ballpark of 30%.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
env PYTHON_CONFIGURE_OPTS='--enable-optimizations --with-lto' PYTHON_CFLAGS='-march=native -mtune=native' pyenv install 3.6.0
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also customize the task used for profile guided optimization by setting
|
||||||
|
the `PROFILE_TASK` environment variable, for instance, `PROFILE_TASK='-m
|
||||||
|
test.regrtest --pgo -j0'` will run much faster than the default task.
|
||||||
|
|
||||||
### Checksum verification
|
### Checksum verification
|
||||||
|
|
||||||
If you have the `shasum`, `openssl`, or `sha256sum` tool installed, python-build will
|
If you have the `shasum`, `openssl`, or `sha256sum` tool installed, python-build will
|
||||||
|
|
Loading…
Reference in a new issue