Re: Optimization Opportunities 1 [long]


Subject: Re: Optimization Opportunities 1 [long]
From: Thomas Fletcher (thomasf@qnx.com)
Date: Mon Feb 05 2001 - 08:26:44 CST


On Mon, 5 Feb 2001, Sam TH wrote:

> Well, I've been playing with the wonderful gcov program (which has now
> tripled the size of my source tree), and I have some interesting
> data. This is just on startup time, one of the key measures that
> users will judge the speed of AbiWord by. More on other aspects
> later. =20

Just out of curiosity ... gcov is a code coverage tool (for example
checking test case coverage) and really has nothing to do with
execution time performance profiling. The output from gprof is
really what you want here. You might think that you can profile
code and then highlight the problem areas and look at the coverage,
but this may provide you with some very mis-leading results showing
that a highly travelled path (ie high coverage numbers) might need
to be sped up ... when in fact it is the low coverage path that is
only incidentally executed that is consuming CPU resources.

My first suggestion to anyone that is interested in doing any sort
of profiling and performance improvements is to walk through the
entire code from startup -> Screen on page through the debugger.
This will benefit for several reasons:
1) You get to become comfortable with the current execution path
   and the code that is associated with it.
2) You get an immediate feel for where loops occur and how long
   any of those loops might take (ie next, next, next ... god
   why are we doing all of this work, next, next, next ... )
3) Often using a combination of function step into and a function
   step over you can find out where the slow spots are in the
   code (gee that function took a long time to return ... this
   one took no time at all).

Having done this you are now in a pretty good position to understand
the result from the profiler and to think about how code might be
re-factored to be more efficient since lots of times that is the
work that has to be done to get performance improvements.

Just a couple of thoughts from someone who has been there before.

Thomas
-------------------------------------------------------------
Thomas (toe-mah) Fletcher QNX Software Systems
thomasf@qnx.com Neutrino Development Group
(613)-591-0931 http://www.qnx.com/~thomasf



This archive was generated by hypermail 2b25 : Mon Feb 05 2001 - 08:25:57 CST