Debian Codegraph @

doc/guide/src/Profiling.adoc

raw
1 = Profiling
2
3 With MLton and `mlprof`, you can profile your program to find out
4 bytes allocated, execution counts, or time spent in each function. To
5 profile you program, compile with ``-profile __kind__``, where _kind_
6 is one of `alloc`, `count`, or `time`. Then, run the executable,
7 which will write an `mlmon.out` file when it finishes. You can then
8 run `mlprof` on the executable and the `mlmon.out` file to see the
9 performance data.
10
11 Here are the three kinds of profiling that MLton supports.
12
13 * <<ProfilingAllocation#>>
14 * <<ProfilingCounts#>>
15 * <<ProfilingTime#>>
16
17 == Next steps
18
19 * <<CallGraph#>>s to visualize profiling data.
20 * <<HowProfilingWorks#>>
21 * <<MLmon#>>
22 * <<MLtonProfile#>> to selectively profile parts of your program.
23 * <<ProfilingTheStack#>>
24 * <<ShowProf#>>