A method and apparatus for averaging out variations from run to run of a
computer program are provided. With the apparatus and method, call trees
are generated for two or more executions of a build of a computer
program. The apparatus and method perform a "tree-addition" operation in
which the two or more call trees generated during runs of the computer
program are added to one another to thereby accumulate statistics for
each call in the call trees. These statistics may then be divided by the
number of runs whose tree data structures are being accumulated. In this
way, an average of the tree data structures is generated. In addition,
any portions of the tree data structure that are due to asynchronous
events are averaged out so that their relative affect in the resulting
tree data structure is minimized.