Fedora 41 Looks To "-O3" Optimizations For Its Python Build
A change proposal has been filed for building the CPython interpreter and the Python standard library using the "-O3" compiler optimization flag rather than Fedora's imposed default of the "-O2" optimization level. This is being sought in the name of greater Python performance on Fedora 41.
Red Hat engineer Miro Hrončok laid out the change proposal for compiling Fedora 41's Python package using -O3 rather than -O2. This matches upstream Python's release builds going for -O3 while -O2 is just used on Fedora per the distribution's default mandate.
By using -O3 rather than -O2, the Fedora Python package was found to deliver 1.04x the performance overall but in some particular micro-benchmarks was as much as 1.08~1.16x the -O2 performance.
The only possible downside expressed so far is the possibility of a slightly larger Python package but the disk space increase using the -O3 optimization level should be less than 2%.
Overall it's a sane change for bettering the Python performance on Fedora. This F41 change proposal still needs to clear the Fedora Engineering and Steering Committee (FESCo) but those interested in the current plans can find them via the Fedora Wiki.
Red Hat engineer Miro Hrončok laid out the change proposal for compiling Fedora 41's Python package using -O3 rather than -O2. This matches upstream Python's release builds going for -O3 while -O2 is just used on Fedora per the distribution's default mandate.
By using -O3 rather than -O2, the Fedora Python package was found to deliver 1.04x the performance overall but in some particular micro-benchmarks was as much as 1.08~1.16x the -O2 performance.
The only possible downside expressed so far is the possibility of a slightly larger Python package but the disk space increase using the -O3 optimization level should be less than 2%.
Overall it's a sane change for bettering the Python performance on Fedora. This F41 change proposal still needs to clear the Fedora Engineering and Steering Committee (FESCo) but those interested in the current plans can find them via the Fedora Wiki.
30 Comments