profiling

Stephen Weeks MLton@sourcelight.com
Thu, 19 Apr 2001 17:16:19 -0700 (PDT)


> > I missed something.  Why did the type of Time.times change?
> 
> The old version of Time.times was:
...
> (which reflected the Posix.ProcEnv.times function), and the new version
> is the following:
...
> I guess there's no reason that it had to change, but I thought that
> exporting the finer grained gc timing would be useful.  And nothing in the
> compiler libraries looks at elapsed.

Makes sense.

> Well, my feeling is that Posix.ProcEnv.times should correspond to the
> POSIX times function -- goofy as that function might be.  I guess my
> fundamental issue would be with the Basis Library, because it requires the
> results to be of type Time.time, rather than as clock ticks, and it
> doesn't specify how the conversion (i.e., what rounding) should be done
> when converting from clock ticks to Time.time.

You should probably mention this to Reppy.

> The other issue with using getrusage is that it will require three
> successive system calls.  One with RUSAGE_SELF, one with RUSAGE_CHILDREN,
> and one to get elapsed, which isn't in the rusage struct.  Maybe it's just
> me, but the times function feels like it gives me a snapshot of all the
> times, whereas when we make successive calls, I know that they are reading
> different times.  (This bothers me with the MLton.RUsage.rusage
> implementation, but I don't know of any way around it.)

OK.  Let's stick with times.  But it will be (yet another) part of the basis
library that we avoid, i.e., times isn't used anymore in MLton, right?