Path: utzoo!attcan!uunet!husc6!purdue!umd5!mimsy!jds
From: jds@mimsy.UUCP (James da Silva)
Newsgroups: comp.sys.ibm.pc
Subject: Re: Turbo C Debugger (really: profiling under DOS vs. Unix)
Message-ID: <12338@mimsy.UUCP>
Date: 6 Jul 88 20:07:33 GMT
References: <11590@agate.BERKELEY.EDU> <1803@akgua.ATT.COM>
Reply-To: jds@mimsy.umd.edu (James da Silva)
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 37

In article <1803@akgua.ATT.COM> brb@akgua.ATT.COM (Brian R. Bainter) writes:
>From article <11590@agate.BERKELEY.EDU>, by ked@garnet.berkeley.edu (Earl H. Kinmonth):
>>>From what I have seen of it, it also
>>>does profiling. Things are getting better and better.
>> 
>> The profiler is pretty dumb compared to that available for **IX
>> systems.
>
>In case you havn't noticed, DOS (unfortunately) is not anywhere
>near **IX. Get real!

Actually, Brian, a DOS Compiler has the potential to blow away any Unix-based
compiler in the area of profiling; DOS's main weakness is a strength when it
comes to profiling.

The lack of multitasking and protection allow you to get very accurate
results free of any distortions.  The PC's clock chip keeps track of time in
1 microsecond increments.  This counter can be read (for example) at the
entry and exit of each C function.  With a little more work the compiler can
determine the exact net time (the time spent executing inside the function)
and gross time (the time spent in the function + in any functions called) for
each function.

Gprof, on the other hand, has to make the best of the relatively coarse
sampling done by the kernel combined with the call graphs it constructs to
*estimate* the amount of each function's time to attribute to the calling
functions, based on the relative number of calls made.

Unfortunately, I have yet to see a compiler that takes full advantage of
the PC's clock chip to construct a really great profiler.

				- Jaime

----------------------------------------------------------------------
usenet:   uunet!mimsy!jds 				James da Silva
internet: jds@mimsy.umd.edu
      "Stand on each other's shoulders, not on each other's toes."