473,698 Members | 2,398 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 1964
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
2662
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
5344
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
30309
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
2100
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
8678
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7737
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
6525
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
5861
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
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
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
2333
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
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.