Re: programing optimization



On Fri, 23 Feb 2001 00:53:02 EST, Havoc Pennington said:
 - 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

This is usually not a big problem, unless your performance issue is a
tight loop   'for (;;) {if (!call_into_libc() ) break;}' type thing...

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

Of course, the *first* rule of program optimization is to tune the hot
spots first, so if you don't have an accurate profile because you only
spend 3% of your time in that code, it's not a big thing.  Usually, 80%
or more of your time will be spent in 10% of your code - and gprof will
do a good job of telling you were in that 10% you are...


-- 
                                Valdis Kletnieks
                                Operating Systems Analyst
                                Virginia Tech

Attachment: pgpTsy1FrCSFe.pgp
Description: PGP signature



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