Build: enable Python optimizations (PGO & LTO) on Linux
This is used for most Python release builds and has been reported to give a modest 5-10% speedup (depending on the workload). This could be enabled on macOS too but needs to be tested.
This commit is contained in:
parent
8b35db914e
commit
f222fe6a3a
|
@ -88,6 +88,18 @@ else()
|
||||||
export LDFLAGS=${PYTHON_LDFLAGS} &&
|
export LDFLAGS=${PYTHON_LDFLAGS} &&
|
||||||
export PKG_CONFIG_PATH=${LIBDIR}/ffi/lib/pkgconfig)
|
export PKG_CONFIG_PATH=${LIBDIR}/ffi/lib/pkgconfig)
|
||||||
|
|
||||||
|
# NOTE: untested on APPLE so far.
|
||||||
|
if(NOT APPLE)
|
||||||
|
set(PYTHON_CONFIGURE_EXTRA_ARGS
|
||||||
|
${PYTHON_CONFIGURE_EXTRA_ARGS}
|
||||||
|
# Used on most release Linux builds (Fedora for e.g.),
|
||||||
|
# increases build times noticeably with the benefit of a modest speedup at runtime.
|
||||||
|
--enable-optimizations
|
||||||
|
# Also used for Fedora's release builds.
|
||||||
|
--with-lto
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
ExternalProject_Add(external_python
|
ExternalProject_Add(external_python
|
||||||
URL file://${PACKAGE_DIR}/${PYTHON_FILE}
|
URL file://${PACKAGE_DIR}/${PYTHON_FILE}
|
||||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||||
|
|
Loading…
Reference in New Issue