[MLton-devel] Re: MLton profiler call-graph improvements

Joe Hurd joe.hurd@cl.cam.ac.uk
Wed, 9 Jul 2003 22:49:15 +0100 (BST)


Hi Stephen,

thanks for making the profiling changes. I've just played around with
the new version, and I'm really pleased with the results.  Here are a
few comments:

1. After trying a few arrangements, I found I got the best high-level
view of my program splitting everything (i.e., using -split '.*'). You
might consider making splitting the default, and using a -glob
argument to override this. (Of course, a function satisfying the -glob
predicate should still be split if it is not going to be displayed).

2. I found that most of the lines in my graph were dotted, which made
it quite hard to read. By hacking the .dot file, I changed all the
dotted lines to dashed, and the result is a lot clearer.

3. I struggled with the regular expressions in mlprof. The
documentation suggests that the regular expression has to match the
whole function name, but

mlprof -keep '"M"' benchmark mlmon.out

seems to print all functions starting with M. I was actually trying to
match all functions with more than one dot in them, using things like

mlprof -keep '".*\\..*\\."' benchmark mlmon.out

But I couldn't get anything to work. Also, do the regular expressions
support the [^ ] operator? Based on the first example, I was expecting

mlprof -keep '"[^M]"' benchmark mlmon.out

to match all functions that don't start with M, but it seems to match
every function. All very confusing.

4. A remark: To get an appropriately high-level view of my program, I
found I had to be rather aggressive with culling modules:

DROP      = Basis1997\..*|General\..*|Binarymap\..*|List\..*|
            Useful\..*|Stream\..*|Subst\..*|Match\..*|Clauseset\.ofilt

mlprof -keep '(and (and (thresh-stack 5) (from "Solver.solve .*"))
                   (not "$(DROP)"))'  -split '.*' benchmark mlmon.out

However, once I'd done that, the display I got was extremely high
quality: much better than the last version of source-level profiling.

In summary: great job, big improvement, though I'd like to see a
couple of tweaks. Though perhaps some customers are simply never
satisfied :-)

Regards,

Joe

PS I had a bit of trouble getting my program to compile. It calls a
library containing a function for computing hashes of arbitrary
precision integers, and it was implemented like this:

  structure I = MLton.IntInf;
  structure V = Vector;
  structure W = Word;

  fun hash n =
    case I.rep n of
      I.Small w => W.toIntX w
                   ^^^^^^^^
    | I.Big v   =>
        let val k = W.toIntX (V.foldli (fn (_,w,acc) => w + acc) 0w0 (v,1,NONE))
        in if V.sub (v,0) = 0w0 then k else ~k
        end;

But it seems you changed the representation of integers, so I.Small
now takes an integer. I therefore removed the underlined call to
W.toIntX, and the program compiled.




-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel