Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / localhost / Profiling
CommitLineData
7f918cf1
CE
1<!DOCTYPE html>\r
2<html lang="en">\r
3<head>\r
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\r
5<meta name="generator" content="AsciiDoc 8.6.9">\r
6<title>Profiling</title>\r
7<link rel="stylesheet" href="./asciidoc.css" type="text/css">\r
8<link rel="stylesheet" href="./pygments.css" type="text/css">\r
9\r
10\r
11<script type="text/javascript" src="./asciidoc.js"></script>\r
12<script type="text/javascript">\r
13/*<![CDATA[*/\r
14asciidoc.install();\r
15/*]]>*/\r
16</script>\r
17<link rel="stylesheet" href="./mlton.css" type="text/css">\r
18</head>\r
19<body class="article">\r
20<div id="banner">\r
21<div id="banner-home">\r
22<a href="./Home">MLton 20180207</a>\r
23</div>\r
24</div>\r
25<div id="header">\r
26<h1>Profiling</h1>\r
27</div>\r
28<div id="content">\r
29<div id="preamble">\r
30<div class="sectionbody">\r
31<div class="paragraph"><p>With MLton and <span class="monospaced">mlprof</span>, you can profile your program to find out\r
32bytes allocated, execution counts, or time spent in each function. To\r
33profile you program, compile with <span class="monospaced">-profile <em>kind</em></span>, where <em>kind</em>\r
34is one of <span class="monospaced">alloc</span>, <span class="monospaced">count</span>, or <span class="monospaced">time</span>. Then, run the executable,\r
35which will write an <span class="monospaced">mlmon.out</span> file when it finishes. You can then\r
36run <span class="monospaced">mlprof</span> on the executable and the <span class="monospaced">mlmon.out</span> file to see the\r
37performance data.</p></div>\r
38<div class="paragraph"><p>Here are the three kinds of profiling that MLton supports.</p></div>\r
39<div class="ulist"><ul>\r
40<li>\r
41<p>\r
42<a href="ProfilingAllocation">ProfilingAllocation</a>\r
43</p>\r
44</li>\r
45<li>\r
46<p>\r
47<a href="ProfilingCounts">ProfilingCounts</a>\r
48</p>\r
49</li>\r
50<li>\r
51<p>\r
52<a href="ProfilingTime">ProfilingTime</a>\r
53</p>\r
54</li>\r
55</ul></div>\r
56</div>\r
57</div>\r
58<div class="sect1">\r
59<h2 id="_next_steps">Next steps</h2>\r
60<div class="sectionbody">\r
61<div class="ulist"><ul>\r
62<li>\r
63<p>\r
64<a href="CallGraph">CallGraph</a>s to visualize profiling data.\r
65</p>\r
66</li>\r
67<li>\r
68<p>\r
69<a href="HowProfilingWorks">HowProfilingWorks</a>\r
70</p>\r
71</li>\r
72<li>\r
73<p>\r
74<a href="MLmon">MLmon</a>\r
75</p>\r
76</li>\r
77<li>\r
78<p>\r
79<a href="MLtonProfile">MLtonProfile</a> to selectively profile parts of your program.\r
80</p>\r
81</li>\r
82<li>\r
83<p>\r
84<a href="ProfilingTheStack">ProfilingTheStack</a>\r
85</p>\r
86</li>\r
87<li>\r
88<p>\r
89<a href="ShowProf">ShowProf</a>\r
90</p>\r
91</li>\r
92</ul></div>\r
93</div>\r
94</div>\r
95</div>\r
96<div id="footnotes"><hr></div>\r
97<div id="footer">\r
98<div id="footer-text">\r
99</div>\r
100<div id="footer-badges">\r
101</div>\r
102</div>\r
103</body>\r
104</html>\r