[MLton-devel] Solaris port

Stephen Weeks MLton@mlton.org
Thu, 5 Jun 2003 09:49:17 -0700


> 1) mods in the GC for avoiding calls to getrusage when it is not
> needed. Perhaps I forgot cases ?

For the three (minorGC, cheneyCopy, markCompact) it should be
sufficient to protect the {start,stop}Timing with "if (s->summary)",
since that is the only time those timings are used.

For doGC, it is not so easy, because the gc time can be used by SML
code via MLton.Rusage.rusage and Timer.checkGCTime.  We could keep
track of whether the program uses MLton_Rusage_ru, and if not, then
cut that {start,stop}Timing as well.  But that's starting to sound
messy to me, especially fixing the above three and with the getpid fix
I propose below.

> 2) a graphical depiction of the time spend in system mode on our
> app under Solaris (this is obtained by truss -c -f ...). It shows
> that getpid() is costly (our app calls getpid only once).

We can cache getpid in gcState and ensure that there is never more
than one cal to getpid () per process.



-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel