Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 724002

Summary: dev-lang/python: lto USE flags request
Product: Gentoo Linux Reporter: Joel Berendzen <joel>
Component: Current packagesAssignee: Python Gentoo Team <python>
Status: RESOLVED FIXED    
Severity: enhancement CC: sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=615412
https://bugs.gentoo.org/show_bug.cgi?id=700012
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: pyperformance comparison, py37 with pgo enabled

Description Joel Berendzen 2020-05-19 18:23:17 UTC
Created attachment 640354 [details]
pyperformance comparison, py37 with pgo enabled

I spend a lot of my time developing and running python codes.  Now that gcc10 is unmasked, with its improved lto and pgo options, I decided to see if enabling those are worth it.

The answer is "yes, definitely" for me.  The attachment shows the result of a pyperformance run, with the only differences being "--enable-optimizations" and "--with-lto" added to the ebuild.   Enabling pgo causes sandbox errors, so I had to disable that with FEATURES.  I set CFLAGS="-O3 -pipe -march=native -flto  -fno-semantic-interposition" on my Intel Core-i7 6700K CPU.  Compilation time was 40 minutes, about a factor of 3 slower.

Speedups as reported by pyperformance range from 1.07 to 1.37, with a median-by-eyeball at around 1.13.  The benchmarks closest to what I do most are around 17%.  17% may not sound like much, but for as much as I'm waiting for codes to run, this is something like getting a week of my life back every year.  

There is considerable overlap in this request with Bug 700012 but (in my hands, at least) the speedup from LTO is minor compared with PGO.

I request "pgo" and "lto" USE flags be added to the python ebuilds that turn on "--enable-optimizations" and "--with-lto".  Some work will need to be done on the build system to avoid the sandbox violations.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-05-19 18:30:47 UTC
See the other bug (bug 615412) for PGO discussion.
Comment 2 Joel Berendzen 2020-05-26 18:41:08 UTC
Please close in favor of bug 61541.

I submitted patches there.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-17 12:27:30 UTC
Fixed as part of bug 700012.