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