473,734 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C Compiler and "Profile Guided Optimizations"

Does anybody have some benchmarks or links to articles that compare
this for different compiler implementations ?
I would especially like to see if it is usefull on MSVC, Intel 9.0 C
and gcc.
Also what is about the effect of "interprocedura l optimization".

All my use cases are 98% integer performance dominated. Currently i
only use -O2 or -O3 for MSVC and gcc but i would really like to now if
it is worth to spend time on optimization (which means that i would
see a 20% improvement by this two kinds of optimizations).

May 12 '07 #1
7 1966
On 12 Mai, 23:35, llothar <llot...@web.de wrote:
Also what is about the effect of "interprocedura l optimization".
Let me clarify this, i'm already using inline for functions that i
think are good to inline (everything that is just a few statements
long and does not have local declared variables or conditionals).

May 12 '07 #2
llothar wrote:
On 12 Mai, 23:35, llothar <llot...@web.de wrote:
>Also what is about the effect of "interprocedura l optimization".

Let me clarify this, i'm already using inline for functions that i
think are good to inline (everything that is just a few statements
long and does not have local declared variables or conditionals).
Don't bother, a decent compiler will take care of inlining for you.

--
Ian Collins.
May 12 '07 #3
llothar wrote:
Does anybody have some benchmarks or links to articles that compare
this for different compiler implementations ?
I would especially like to see if it is usefull on MSVC, Intel 9.0 C
and gcc.
Also what is about the effect of "interprocedura l optimization".

All my use cases are 98% integer performance dominated. Currently i
only use -O2 or -O3 for MSVC and gcc but i would really like to now if
it is worth to spend time on optimization (which means that i would
see a 20% improvement by this two kinds of optimizations).
You really should try this with your own code, all code is different and
what works well for one author may not work at all for you. I always
experiment with profile driven optimisations for each new application to
find the best combinations for it.

--
Ian Collins.
May 12 '07 #4
On May 12, 9:35 am, llothar <llot...@web.de wrote:
Does anybody have some benchmarks or links to articles that compare
this for different compiler implementations ?
PGO is usually best for runtime feedback on branch prediction
statistics. The compiler can then use the hinted branch instructions,
or flip the sense of the branch so it tends to be fall through more of
the time (this is better on the decoders and trace cache.) However,
this really tended to make more of a difference with the deeply
pipelined P4s than he relatively shorter pipeline Athlon/Opteron and
Core architectures.
I would especially like to see if it is usefull on MSVC, Intel 9.0 C
and gcc. Also what is about the effect of "interprocedura l optimization".
I don't remember. I usually just turned it on and saw no difference.
But that's because my code tends to lean on inner loops, not call
overhead.
All my use cases are 98% integer performance dominated. Currently i
only use -O2 or -O3 for MSVC and gcc but i would really like to now if
it is worth to spend time on optimization (which means that i would
see a 20% improvement by this two kinds of optimizations).
Truly integer limited? As in cryptography or something of that
nature? If so, then your best bet is to try for SIMD or just general
parallelism. If that doesn't buy you anything, then there's not much
you can do with the "micro-optimization" angle.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

May 12 '07 #5
On 13 Mai, 04:22, websn...@gmail. com wrote:
Truly integer limited? As in cryptography or something of that
nature? If so, then your best bet is to try for SIMD or just general
As in data movement and script interpreter execution.
I really can't see any real use for SIMD in this case, but it has a
lot
of calls/jumps thats why i ased about PGO.

But it seems that nobody has a real success story that make me curious
enough to see if there is a speed burst.

May 13 '07 #6
llothar wrote:
On 13 Mai, 04:22, websn...@gmail. com wrote:
>Truly integer limited? As in cryptography or something of that
nature? If so, then your best bet is to try for SIMD or just general

As in data movement and script interpreter execution.
I really can't see any real use for SIMD in this case, but it has a
lot
of calls/jumps thats why i ased about PGO.

But it seems that nobody has a real success story that make me curious
enough to see if there is a speed burst.
That depends how you judge success. The best I have seen is about a 10%
speed up with one of my applications, where I had a good set of
representative data to run through the training runs for the profiler.

It shouldn't take you long to try it out for yourself.

--
Ian Collins.
May 13 '07 #7
Ian Collins wrote:
llothar wrote:
>On 13 Mai, 04:22, websn...@gmail. com wrote:
>>Truly integer limited? As in cryptography or something of that
nature? If so, then your best bet is to try for SIMD or just general
As in data movement and script interpreter execution.
I really can't see any real use for SIMD in this case, but it has a
lot
of calls/jumps thats why i ased about PGO.

But it seems that nobody has a real success story that make me curious
enough to see if there is a speed burst.
That depends how you judge success. The best I have seen is about a 10%
speed up with one of my applications, where I had a good set of
representative data to run through the training runs for the profiler.

It shouldn't take you long to try it out for yourself.
Successful compilers have had to improve their handling of the case
without PGO, leaving less improvement to be gained. There are too many
applications where PGO is impractical, so good optimization without it
could also be taken as a success.
May 13 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
2667
by: Marc Le Roy | last post by:
Hello, ADA Ravenscar is a restricted subset of the ADA language that has been defined for real-time software development in safety critical applications. Completed with additional restrictions like the ones defined in the SPARK profile, it allow to build very deterministic applications that support automatic static code analysis and schedulability analysis. http://www.acm.org/pubs/articles/proceedings/ada/289524/p1-dobbing/p1-dobbing.pdf...
10
5352
by: fei.liu | last post by:
Consider the following sample code char * ptr = "hello"; char carray = "hello"; int main(void){ } What does the standard have to say about the storage requirement about ptr and carray? Is it a fair statement that char *ptr will take 4 more bytes (on 32bit platform) in DATA segment? I have found
94
30333
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock Statement (C# Reference) statement to serialize access. " But when is it better to use "volatile" instead of "lock" ?
4
2103
by: R.A.M. | last post by:
Hello, I am writing ASP.NET application in which I need to use User Profiles and Session mechanisms. Here I include part of my source code (Admin.cs): using System; using System.Data; using System.Data.Sql; using System.Data.SqlClient; using System.Data.SqlTypes;
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.