View previous topic :: View next topic |
Author |
Message |
krumpf Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 15 Jul 2018 Posts: 192
|
Posted: Fri Jun 23, 2023 3:59 pm Post subject: gcc pgo flag : worth it ? |
|
|
Hi.
From equery u gcc
Quote: | 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 ? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Thistled Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/1484846943533ff61a56876.jpg)
Joined: 06 Jan 2011 Posts: 572 Location: Scotland
|
Posted: Sun Jul 02, 2023 12:30 am Post subject: |
|
|
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! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Naib Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/10548223558c42f2887453.jpg)
Joined: 21 May 2004 Posts: 6070 Location: Removed by Neddy
|
Posted: Fri Jul 07, 2023 2:29 pm Post subject: |
|
|
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; |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Goverp Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/152613747847c6fd276c31a.jpg)
Joined: 07 Mar 2007 Posts: 2204
|
Posted: Fri Jul 07, 2023 5:50 pm Post subject: Re: gcc pgo flag : worth it ? |
|
|
krumpf wrote: | Hi.
From equery u gcc
Quote: | 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 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
krumpf Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 15 Jul 2018 Posts: 192
|
Posted: Sat Jul 08, 2023 6:48 pm Post subject: Re: gcc pgo flag : worth it ? |
|
|
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 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Goverp Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/152613747847c6fd276c31a.jpg)
Joined: 07 Mar 2007 Posts: 2204
|
Posted: Sat Jul 08, 2023 7:16 pm Post subject: |
|
|
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 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|