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

Stephen Weeks MLton@mlton.org
Wed, 9 Jul 2003 22:52:53 -0700


Thanks for more great feedback!  The squeaky wheel gets the grease.

> You might consider making splitting the default and using a -glob
> argument to override this.

I'll keep it in mind.  But I think it's easiest for new users (of
which you are one no longer :-) to not have to know about splitting.

> 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.

OK.  I'll change dotted to dashed.

> 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. 

Whoops.  The experimental release you got had out of date
documentation.  20030708 docs are much better.  And yes, regular
expressions now match prefixes.  I figured that was a more natural
choice, and also causes less confusion with -show-line true.

> 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. 

The problem is that regexps match a prefix of the concatenation of
function name, a space, and source position.  That is now documented
(it wasn't in 20030708).  So, in your regexp, the dot can match the
dot in the filename part of the source position.  Since the identifier
is separated from the source position with a space, "[^ ]*\\.[^ ]*\\." 
will work to match identifiers with two or more dots.

BTW, I arrived at this point in the design space because I wanted to
allow regexps matching on the source position, and I thought it was
confusing to have the regexp meaning change depending on the value of
-show-line as was done in 20030312.  So, for 20030707 and beyond, I
went for a fixed meaning for the regexp: match a prefix of the
concatenation of function name, a space, and source position.  I'm
open to suggestions on better points in the design space, but at least
I think this is better than how 20030312 behaved.

> 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.

Sorry about that.  MLton's regexp library does support [^ ], but it
was implemented incorrectly.  I have checked in a fix.  Hopefully [^M]
will now do what you want.

> 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

Maybe it would be easier to use a positive statement of what you want
to see instead of dropping stuff out?  Something like

	(or "Solver.solve" ...)

> PS I had a bit of trouble getting my program to compile. 
...
> 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.

Yeah, we did change the representation, since it makes it clearer what
the Small case is.  It's documented in 20030708 and beyond.

All these changes will go into the next release, which should be in a
day or two.

Thanks again for alpha testing.



-------------------------------------------------------
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