File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,27 @@ build the :py:mod:`ctypes` module (without the flag the rest of CPython will
237237still build properly).
238238
239239
240+ Optimization
241+ ''''''''''''
242+
243+ If you are trying to improve CPython's performance, you will probably want
244+ to use an optimized build of CPython. It can take a lot longer to build CPython
245+ with optimizations enabled, and it's usually not necessary to do so. However,
246+ it's essential if you want accurate benchmark results for a proposed performance
247+ optimization.
248+
249+ For an optimized build of Python, use
250+ ``configure --enable-optimizations --with-lto ``.
251+ This sets the default make targets up to enable Profile Guided Optimization (PGO)
252+ and may be used to auto-enable Link Time Optimization (LTO) on some platforms.
253+ See :option: `python:--enable-optimizations ` and :option: `python:--with-lto `
254+ to learn more about these options.
255+
256+ .. code :: console
257+
258+ $ ./configure --enable-optimizations --with-lto
259+
260+
240261 .. _windows-compiling :
241262
242263Windows
You can’t perform that action at this time.
0 commit comments