Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

gcc pgo flag : worth it ?

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
krumpf
Apprentice
Apprentice
User avatar
Posts: 268
Joined: Sun Jul 15, 2018 11:21 pm

gcc pgo flag : worth it ?

  • Quote

Post by krumpf » Fri Jun 23, 2023 3:59 pm

Hi.
From equery u gcc
GCC will build itself and then analyze the just-built binary and then rebuild itself using the data obtained from analysis of codepaths taken.
It does not affect whether GCC itself supports PGO when building other software. This substantially increases the build time needed for building GCC itself.
So I'm wondering, does it actually decrease compilation times for other programs ? Does it just affect the final size of generated binaries ?
Users who enabled pgo for gcc, what's your experience with it ? It is worth it ?
Top
Thistled
Guru
Guru
User avatar
Posts: 572
Joined: Thu Jan 06, 2011 6:57 pm
Location: Scotland
Contact:
Contact Thistled
Website

  • Quote

Post by Thistled » Sun Jul 02, 2023 12:30 am

Why not give it a try and see for yourself?
That's the beauty of Gentoo. You learn so much in the process of experimentation.
Whatever you do, do it properly!
Top
Naib
Watchman
Watchman
User avatar
Posts: 6101
Joined: Fri May 21, 2004 9:42 pm
Location: Removed by Neddy
Contact:
Contact Naib
Website

  • Quote

Post by Naib » Fri Jul 07, 2023 2:29 pm

please bear in mind that this increases compile time alot and GCC is bumped quite frequently in ~arch and while PGO could yield 5-7% improvements, there is a chance this improvement in GCC usage is totally lost due to the frequency of revision bumps
#define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0;
Top
Goverp
Advocate
Advocate
User avatar
Posts: 2402
Joined: Wed Mar 07, 2007 6:41 pm

Re: gcc pgo flag : worth it ?

  • Quote

Post by Goverp » Fri Jul 07, 2023 5:50 pm

krumpf wrote:Hi.
From equery u gcc
GCC will build itself and then analyze the just-built binary and then rebuild itself using the data obtained from analysis of codepaths taken
. ...
I find pgo enthusiasm a bit misguided sometimes. Using pgo as above should optimize gcc compiling gcc - not necessarily anything else...
I'm sure I read the "recommended" use of pgo with python was to gather statistics for python compiling its test suite, which of course optimises it for, er, compiling the test suite, rather than anything real.

If you are going to use pgo to improve gcc performance, you probably should collect statistics for all use of gcc over a number of portage updates, and if you use gcc for your own code, that too, and only then feed the results to pgo. But, of course, that's (a) a lot of hassle, and (b) going to give a prolonged period of bad performance while you collect those stats. What pgo gives with one hand, it takes with the other.
Greybeard
Top
krumpf
Apprentice
Apprentice
User avatar
Posts: 268
Joined: Sun Jul 15, 2018 11:21 pm

Re: gcc pgo flag : worth it ?

  • Quote

Post by krumpf » Sat Jul 08, 2023 6:48 pm

Goverp wrote:If you are going to use pgo to improve gcc performance, you probably should collect statistics for all use of gcc over a number of portage updates, and if you use gcc for your own code, that too, and only then feed the results to pgo. But, of course, that's (a) a lot of hassle, and (b) going to give a prolonged period of bad performance while you collect those stats. What pgo gives with one hand, it takes with the other.
So I guess the answer to my question is : nope, not worth it for an ordinary user.

Thanks folks for the feedback.
Last edited by krumpf on Sat Jul 08, 2023 8:33 pm, edited 1 time in total.
Top
Goverp
Advocate
Advocate
User avatar
Posts: 2402
Joined: Wed Mar 07, 2007 6:41 pm

  • Quote

Post by Goverp » Sat Jul 08, 2023 7:16 pm

The one place I'd expect worthwhile gains from pgo is if you were spending a lot of time running Qemu to simulate say a Raspberry Pi - then it would be worth collecting stats for a typical job stream on the emulated Pi. That's assuming Qemu is written in a language the compiler for which supports pgo - not something I know about.
Greybeard
Top
Post Reply

6 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic