<iyossi@my-dejanews.com> wrote in message 98-11-078@comp.compilers...
[snip]>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?

No; if some branches are rarely taken, this is exactly what profiling is
trying to determine.

Some very important optimizations (e.g. procedure inlining) depend on
finding the most common branches. Inlining commonly-called procedures can
dramatically improve performance, but inlining the wrong procedures only
causes code bloat. Profiling can be especially useful for object oriented
languages where viritual procedures make inlining much more difficult to do
effectivlely. The UW Cecil/Vortex project is a good example of using
profiling to guide optimizations like this.