
Tool for C-program performance analysis needed
Quote:
>I'd like to have a tool that shows how much time was spent in each
>function when the program was run.
>There is some tool like this, I know. I just can't remember the
>name. Actually I believe that there are several tools like this. Can
>anyone recommend something? Was there some GNU tool for this purpose?
If you have access to a VMS system with "DECSET" installed you can use
PCA. It's very good for this sort of thing and can analyze your program
several different ways, under different run conditions, and so forth.
Here's part of the HELP file:
The DIGITAL Performance and Coverage Analyzer (PCA) is a software
development tool that helps you analyze the run-time behavior
of application programs. The DIGITAL Performance and Coverage
Analyzer can pinpoint execution bottlenecks and other performance
problems in user programs. Using this information, you can modify
your programs to run faster. This tool also measures which parts
of your program are or are not executed by a given set of test
data so that you can devise tests that exercise all parts of your
program.
A couple of weeks ago PCA helped me find a performance problem having to do
with arrays vs. cache sizes.
The code (fortran) was:
do i=1,N
a(i)=0
b(i)=0
end do
The size of the arrays a and b had been increased and as a consequence they
no longer both fit into cache at the same time. This caused a huge
performance hit which PCA localized to this section of code. Reordering
the code to:
do i=1,N
a(i)=0
end do
do i=1,N
b(i)=0
end do
fixed it.
Regards,
David Mathog
Manager, sequence analysis facility, biology division, Caltech