optimization using profiling

12 Nov 1998 02:34:53 -0500

          From comp.compilers

Related articles
optimization using profiling iyossi@my-dejanews.com (1998-11-12)
Re: optimization using profiling mikey@ontek.com (1998-11-15)
Re: optimization using profiling jrw@pobox.com (John Williams) (1998-11-15)
Re: optimization using profiling joachim.durchholz@munich.netsurf.de (Joachim Durchholz) (1998-11-15)
| List of all articles for this month |

From: iyossi@my-dejanews.com
Newsgroups: comp.compilers
Date: 12 Nov 1998 02:34:53 -0500
Organization: Deja News - The Leader in Internet Discussion
Keywords: optimize, question


Sun's C++ compiler (SC4.2) has an optimization level -O5 which is described :

-O5: Generates the highest level of optimization. Uses optimization algorithms
that take more compilation
          time or that do not have as high a certainty of improving execution time.
Optimization at this level is more
          likely to improve performance if it is done with profile feedback.

-xprofile=p Collects data for a profile or uses a profile to optimize. This
option causes execution frequency data to be collected and saved during the
execution. The data can be used in subsequent runs to improve performance.

How? What can be done after profiling that can't be done without it ?
To get a real improvement, I guess I must run my application to cover
ALL the possibilities (all branches in code), or I'll get worse
performance, since the compiler will think that some code is never or
almost never being executed, right?


[There are a lot of optimizers that can feed back profiling info,
mostly about the relative frequency that parts of the program are
executed. But profiling isn't about code coverage, you need to profile
the program doing what it does to give the optimizer useful info to
guide it. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.