Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 724002 - dev-lang/python: lto USE flags request
Summary: dev-lang/python: lto USE flags request
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-19 18:23 UTC by Joel Berendzen
Modified: 2021-11-17 12:27 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
pyperformance comparison, py37 with pgo enabled (py37_pgo_comparison.txt,7.02 KB, text/plain)
2020-05-19 18:23 UTC, Joel Berendzen
Details

Note You need to log in before you can comment on or make changes to this bug.
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.