4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="generator" content="AsciiDoc 8.6.9">
6 <title>Profiling</title>
7 <link rel="stylesheet" href="./asciidoc.css" type="text/css">
8 <link rel="stylesheet" href="./pygments.css" type="text/css">
11 <script type="text/javascript" src="./asciidoc.js"></script>
12 <script type="text/javascript">
17 <link rel="stylesheet" href="./mlton.css" type="text/css">
19 <body class="article">
21 <div id="banner-home">
22 <a href="./Home">MLton 20180207</a>
30 <div class="sectionbody">
31 <div class="paragraph"><p>With MLton and <span class="monospaced">mlprof</span>, you can profile your program to find out
32 bytes allocated, execution counts, or time spent in each function. To
33 profile you program, compile with <span class="monospaced">-profile <em>kind</em></span>, where <em>kind</em>
34 is one of <span class="monospaced">alloc</span>, <span class="monospaced">count</span>, or <span class="monospaced">time</span>. Then, run the executable,
35 which will write an <span class="monospaced">mlmon.out</span> file when it finishes. You can then
36 run <span class="monospaced">mlprof</span> on the executable and the <span class="monospaced">mlmon.out</span> file to see the
37 performance data.</p></div>
38 <div class="paragraph"><p>Here are the three kinds of profiling that MLton supports.</p></div>
39 <div class="ulist"><ul>
42 <a href="ProfilingAllocation">ProfilingAllocation</a>
47 <a href="ProfilingCounts">ProfilingCounts</a>
52 <a href="ProfilingTime">ProfilingTime</a>
59 <h2 id="_next_steps">Next steps</h2>
60 <div class="sectionbody">
61 <div class="ulist"><ul>
64 <a href="CallGraph">CallGraph</a>s to visualize profiling data.
69 <a href="HowProfilingWorks">HowProfilingWorks</a>
74 <a href="MLmon">MLmon</a>
79 <a href="MLtonProfile">MLtonProfile</a> to selectively profile parts of your program.
84 <a href="ProfilingTheStack">ProfilingTheStack</a>
89 <a href="ShowProf">ShowProf</a>
96 <div id="footnotes"><hr></div>
98 <div id="footer-text">
100 <div id="footer-badges">