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

Document PGO in devguide #1153

Merged
merged 19 commits into from
Aug 13, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .idea/workspace.xml
AlexWaygood marked this conversation as resolved.
Show resolved Hide resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions getting-started/setup-building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,27 @@ build the :py:mod:`ctypes` module (without the flag the rest of CPython will
still build properly).


Optimization
''''''''''''

If you are trying to improve CPython's performance, you will probably want
to use an optimized build of CPython. It can take a lot longer to build CPython
with optimizations enabled, and it's usually not necessary to do so. However,
it's essential if you want accurate benchmark results for a proposed performance
optimization.

For an optimized build of Python, use
``configure --enable-optimizations --with-lto``.
This sets the default make targets up to enable Profile Guided Optimization (PGO)
and may be used to auto-enable Link Time Optimization (LTO) on some platforms.
See :option:`python:--enable-optimizations`, :option:`python:--with-lto` to learn more about
these options.
KilJaeeun marked this conversation as resolved.
Show resolved Hide resolved

.. code:: console

$ ./configure --enable-optimizations --with-lto


.. _windows-compiling:

Windows
Expand Down