Re: programing optimization



dg tao-group com writes: 
> 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.
> 

The tricky things about gprof are:

 - it only works properly if you link statically to all libs

 - you have to rebuild all your libs with -pg (including libc, though
   Red Hat and Debian at least ship a profiling version of that
   prebuilt), but also libX11 and GTK itself, or profile times
   won't include time spent in the libs

 - it has limited precision, so anytime you have code that's only 
   executed infrequently there's no way to get an accurate profile

There's a tool in GNOME CVS, eazel-tools/profiler, that doesn't
require rebuilding your program, but it also has limited precision and
the information it provides is less comprehensive than gprof's.

Havoc





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