Re: programing optimization
- From: Havoc Pennington <hp redhat com>
- To: dg tao-group com
- Cc: gtk-list gnome org, gtk-app-devel-list gnome org
- Subject: Re: programing optimization
- Date: 23 Feb 2001 00:53:02 -0500
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]