profiler problems

brian <briand-/[email protected]> Tue, 26 Aug 2008 22:04:09 -0700
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
Here's one:

- open Compiler.Profile;
[autoloading]
[autoloading done]
stdIn:1.1-1.22 Error: unbound structure: Profile in path  
Compiler.Profile
-

seems there is another Compiler structure conflicting with the one I  
want...

This works:

   sml -m '$smlnj/compiler/compiler.cm'

But I can't seem to make that work in a .cm file, or should I even be  
trying to.

Also I have yet to get the profiler, when I can get it to work (see  
above), to give me any profile information on my actual code.  I seem  
to get a very high level output, something like this

- setProfMode true;
Creating profiled version of standard library
val it = () : unit
- fun fact n = if n<2 then 1 else n * fact(n-1);
val fact = fn : int -> int
- setProfMode false;
val it = () : unit
- setTimingMode true;
val it = () : unit
- fact 12;
val it = 479001600 : int
- setTimingMode false;
val it = () : unit
- reportAll (TextIO.stdOut);
  %time cumsec #call  name
           .00     0  Compilation
           .00     0  Major GC
           .00     0  Minor GC
           .00     0  Other
           .00     0  Run-time System
val it = () : unit

shouldn't it be telling me something about fact ?

I'm running on a mac, but I have the same problem on x86.

A short example would be great.

I've got a program and the run time goes up very non-linear with the  
solution size, i.e. it stays very linear until I get to a certain  
point and then goes up dramatically.  I suspect that it's unable to  
stay in cache once the problem gets too large, but the gc also seems  
to start eating a lot of run time.  I'm hoping the profiler can help  
me figure it out.


Thanks

Brian

P.S.  A short example as to how to set up a backtrace would be great  
too :-)


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/