Re: programing optimization



Does anyone know of a (free?) utility that is capable of analyzing a program and
telling me how much time is being spent and/or cpu usage being consumed by each
function?  Thanks in advance to any who reply.

What you want is gprof. It's a standard component of most free Unices these
days.

What you do is compile your programs (if using gcc) with the -pg option. Then,
when you run them, the program will generate a huge log file. gprof analyses
this log file and gives you more profiling information than you ever wanted to
know.

I'm sending direct to you an example log I got from running pforth with
profiling enabled. It should let you see what sort of things it tells you.

-- 
+- David Given ---------------McQ-+ 
|  Work: dg tao-group com         | Closed mouths gather no feet.             
|  Play: dgiven iname com         | 
+- http://wired.st-and.ac.uk/~dg -+ 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]