0

I have instrumented my application with "stop watches". There is usually one such stop watch per (significant) function. These stop watches measure real time, thread time (and process time, but process time seems less useful) and call count. I can obviously sort the individual stop watches using either of the four values as a key. However that is not always useful and requires me to, e.g., disregard top level functions when looking for optimization opportunities, as top level functions/stop watches measure pretty much all of the application's run time.

I wonder if there is any research regarding any kind of score or heuristics that would point out functions/stop watches that are worthy looking at and optimizing?

wilx
  • 17,697
  • 6
  • 59
  • 114

1 Answers1

0

The goal is to find code worth optimizing, and that's good, but the question presupposes what many people think, which is that they are looking for "slow methods".

However there are other ways for programs to spend time unnecessarily than by having certain methods that are recognizably in need of optimizing. What's more, you can't ignore them, because however much time they take will become a larger and larger fraction of the total if you find and fix other problems.

In my experience performance tuning, measuring time can tell if what you fixed helped, but it is not much use for telling you what to fix. For example, there are many questions on SO from people trying to make sense of profiler output. The method I rely on is outlined here.

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135