Re: Path optimizations
- From: "Jim Langston" <tazmaster@xxxxxxxxxxxxxx>
- Date: Sat, 17 Nov 2007 17:11:48 -0800
"Tim Frink" <plfriko@xxxxxxxx> wrote in message
news:5q8er4Fum3bhU1@xxxxxxxxxxxxxxxxxxxxx
Hi,
some compilers perform profile-driven optimizations, i.e.
they first profile the program by running it and collect
information about the frequency of taken branches and
how often basic blocks have been executed. Based on that,
they get one path through the program that is executed
most frequently.
The profile-based optimizations aim at the optimization
of this path resulting in an decreased execution time
of this program and thus an decreased run-time of the
program for a typical input data set.
I'm now wondering what sort of optimizations can be
performed to that path. The only optimization I know
is block re-ordering by moving blocks such that unconditional
branches are eliminated on the typical path leading to
e.g. an improved pipeline behavior due to missing conditional
hazards.
Most of the optimizations could be applied to the entire
code since they can improve code quality globally so
it does not make sense to perform for example constant
propagation just to this one path and leave the remaining
code unchanged. This is the same for other compiler optmizations
that come into my mind.
Do you know any other optimizations that could be applied in
particular to this one path? This must be some sort of
optimizations that, due to any restrictions, cannot be applied
to the entire code but just to some few code fragments (like
the profiling path).
There is quite a bit of optimization that can take place in code to make it
run faster, such as loop unrolling, branch indexes, inlining code, etc...
There is so much that can be optimized in a program it's more of a question
of what can't be optimized. Most code, however, is not optimized as it
makes the code harder to understand and maintain and is usually a lot of
effort for little gain.
.
- Follow-Ups:
- Re: Path optimizations
- From: Stephan Ceram
- Re: Path optimizations
- References:
- Path optimizations
- From: Tim Frink
- Path optimizations
- Prev by Date: Re: two interesting data structure/algorithm questions
- Next by Date: Re: Network timeout estimation
- Previous by thread: Path optimizations
- Next by thread: Re: Path optimizations
- Index(es):
Relevant Pages
|