I'm trying to compile Python 3.6 on an arm based Linux machine,
If you want a release build with all optimizations active (LTO, PGO, etc),
This flag enables Profile guided optimization (
PGO) and Link Time Optimization (
Both are expensive optimizations that slow down the build process but yield a significant speed boost (around 10-20% from what I remember reading).
The discussion of what these exactly do is beyond my knowledge and probably too broad for a single question. Either way, you can read a bit about the
LTO implementation in
gcc and, get a start by reading the wiki page on
Also, see these relevant issues opened on the Python Bug Tracker, that added these:
--enable-optimizationsflag to the configure script which enables the aforementioned optimizations.)
As pointed out by @Shuo in a comment,
LTO isn't always included with
--enable-optimizations as stated in Issue 28032. Some platforms (depending on the supported version of
gcc), don't have it enabled by default.
Future versions of this flag will probably always have it enabled though, so it's pretty safe to talk about them both here.