[MLton-devel] cvs commit: source-level profiling
Matthew Fluet
fluet@CS.Cornell.EDU
Fri, 3 Jan 2003 18:30:45 -0500 (EST)
Here are a couple of nity-grity questions on profiling:
1. Why do source functions that appear in the final .ssa not appear
in the @MLton show-prof list?
2. How does source mapping interact with pre-closure convert
simplifications?
I can understand that without eta-expanding, something like:
(* F.fun *)
functor F(structure S: sig ... end) = struct fun f n = ... ... end
(* X.sml *)
structure X = F(structure S = struct ... end)
(* Y.sml *)
structure Y = F(structure S = struct ... end)
(* main.sml *)
X.f 10
Y.f 20
will show time in F:1 without distinguishing between X and Y. Is it
true that if I were to eta expand, as in:
(* X.sml *)
structure X = struct
structure X' = F(structure S = struct ... end)
fun f n = X'.f n
...
end
then I would see X:3 as a source function?
Related, I don't understand why some "obvious" source level functions
never even make it to the first .ssa file. I keep going back to
wc-input1.sml with the functorized IO (the commented out code in
<basis>/io/{bin,text}-io.sml). Currently, profiling gives me:
[fluet@localhost cvs.HEAD]$ mlprof wc-input1 mlmon.out
78.26 seconds of CPU time
<main> 99.80%
../wc-input1.sml:29 71.51%
../wc-input1.sml:19 62.93%
<unknown> 27.95%
<gc> 0.20%
<basis>/arrays-and-vectors/sequence.fun:85 0.18%
<basis>/list/list.sml:39 0.13%
<basis>/list/list.sml:106 0.10%
<basis>/posix/io.sml:197 0.03%
The wc-input1.sml:XX make perfect sense:
val rec loop =
fn 0 => ()
| n => (wc f; loop (n - 1))
fun loop (i: int): int =
case input1 ins of
NONE => i
| SOME c => loop (if c = #"\n" then i + 1 else i)
Now, however, I would really expect a sequence of functions detailing
the execution of input1. For example:
<basis>/io/fast-imperative-io.fun:73
<basis>/io/buffer-i.fun:195
<basis>/io/buffer-i.fun:106
<basis>/io/buffer-i.fun:67
Yet, none of these functions even appear in the first .ssa function.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel