Fedora Python 3 performance could be improved by ~15% by building /usr/bin/python* to statically link with a libpython*.a rather than dynamically with libpython*.so. This can be done by removing --enable-shared from the configure arguments. The libpython*.so can be built separately and included in the rpm, or as a separate package. The value of PGO and LTO is diminished significantly by using --enable-shared in the build. PyBench and PyPerformance results both improved by about 15% on average in my experimental builds on Fedora. PyBench results: (average) Fedora 30 stock python3.6 : 2001 ms Fedora 30 python3.6 build from src without --enable-shared: 1709
Experimental PR: https://src.fedoraproject.org/rpms/python3/pull-request/133
A thread on python-devel https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/CYD7F57EFDBNDPMIKXIARIE5VWETYAND/
The speedup can be had using the -fno-semantic-interposition flag, a much less invasive change. It is now tracked as a Fedora Change: https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup