• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Difference/Relationship between profiling and PGO


Well-Known Member

Thanks: 12
Messages: 268

I've noticed in some ports (e.g. off the top of my head www/firefox) make config options (using www/firefox as an example):
     PGO=off: Use Profile-Guided Optimization
     PROFILE=off: Build with profiling support
     TEST=off: Build and/or run tests

I've tried different compilers and mostly just use system cc/c++ (clang 3.3) but regardless have only been able to get anything to compile with "Profiling Support" enabled, never "Profile Guided Optimizations." After searching Google and the forums I really can not find anything on the difference between the two. My main questions are:
1) Really, what is the difference?
2) Are they mutually exclusive or does one depend on the other? (Nothing in Makefile seems to indicate this, but maybe maintainers assume greater end-user knowledge, I'm pretty simpleton when it comes to C/C++, though learning).
3) Advantages/Disadvantages
4) Maybe I'm wrong, but wouldn't OPTIMIZED_CFLAGS be best disabled when trying to use a more "advanced" form of optimization? And I don't really understand what they are/how they work, so for all I know OPTIMIZED_CFLAGS=YES or CFLAGS+= ... would negate benefits from PGO/PROFILE.
5) Has anybody successfully built anything in FreeBSD using PGO?
6) Compiler available to FreeBSD users with best PGO support?

My system:
AMD FX-8350 Black Ed. 8-core/4.0Ghz
16 GB 1866Mhz RAM
nVidia GeForce GTx 650

System Clang/LLVM 3.3
lang/clang33 clang33-3.3_7
lang/clang35 clang35-3.5.0.r2_1
lang/gcc47 gcc47-4.7.4_1,1
lang/gcc49 gcc49-4.9.2.s20140917
lang/gcc5 gcc5-5.0.s20140914