1 <chapter id="profiling">
2 <title>Profiling</Title>
3 <indexterm><primary>profiling</primary>
5 <indexterm><primary>cost-centre profiling</primary></indexterm>
7 <Para> Glasgow Haskell comes with a time and space profiling
8 system. Its purpose is to help you improve your understanding of
9 your program's execution behaviour, so you can improve it.</Para>
11 <Para> Any comments, suggestions and/or improvements you have are
12 welcome. Recommended “profiling tricks” would be
13 especially cool! </Para>
15 <para>Profiling a program is a three-step process:</para>
19 <para> Re-compile your program for profiling with the
20 <literal>-prof</literal> option, and probably one of the
21 <literal>-auto</literal> or <literal>-auto-all</literal>
22 options. These options are described in more detail in <xref
23 linkend="prof-compiler-options"> </para>
24 <indexterm><primary><literal>-prof</literal></primary>
26 <indexterm><primary><literal>-auto</literal></primary>
28 <indexterm><primary><literal>-auto-all</literal></primary>
33 <para> Run your program with one of the profiling options
34 <literal>-p</literal> or <literal>-h</literal>. This generates
35 a file of profiling information.</para>
36 <indexterm><primary><literal>-p</literal></primary><secondary>RTS
37 option</secondary></indexterm>
38 <indexterm><primary><literal>-h</literal></primary><secondary>RTS
39 option</secondary></indexterm>
43 <para> Examine the generated profiling information, using one of
44 GHC's profiling tools. The tool to use will depend on the kind
45 of profiling information generated.</para>
51 <title>Cost centres and cost-centre stacks</title>
53 <para>GHC's profiling system assigns <firstterm>costs</firstterm>
54 to <firstterm>cost centres</firstterm>. A cost is simply the time
55 or space required to evaluate an expression. Cost centres are
56 program annotations around expressions; all costs incurred by the
57 annotated expression are assigned to the enclosing cost centre.
58 Furthermore, GHC will remember the stack of enclosing cost centres
59 for any given expression at run-time and generate a call-graph of
60 cost attributions.</para>
62 <para>Let's take a look at an example:</para>
65 main = print (nfib 25)
66 nfib n = if n < 2 then 1 else nfib (n-1) + nfib (n-2)
69 <para>Compile and run this program as follows:</para>
72 $ ghc -prof -auto-all -o Main Main.hs
78 <para>When a GHC-compiled program is run with the
79 <option>-p</option> RTS option, it generates a file called
80 <filename><prog>.prof</filename>. In this case, the file
81 will contain something like this:</para>
84 Tue Apr 18 12:52 2000 Time and Allocation Profiling Report (Final)
88 total time = 0.14 secs (7 ticks @ 20 ms)
89 total alloc = 8,741,204 bytes (excludes profiling overheads)
91 COST CENTRE MODULE %time %alloc
96 COST CENTRE MODULE scc %time %alloc inner cafs
98 MAIN MAIN 0 0.0 0.0 0 1
99 main Main 0 0.0 0.0 0 1
100 CAF PrelHandle 3 0.0 0.0 0 3
101 CAF PrelAddr 1 0.0 0.0 0 0
102 CAF Main 6 0.0 0.0 1 0
103 main Main 1 0.0 0.0 1 1
104 nfib Main 242785 100.0 100.0 242784 4
108 <para>The first part of the file gives the program name and
109 options, and the total time and total memory allocation measured
110 during the run of the program (note that the total memory
111 allocation figure isn't the same as the amount of
112 <emphasis>live</emphasis> memory needed by the program at any one
113 time; the latter can be determined using heap profiling, which we
114 will describe shortly).</para>
116 <para>The second part of the file is a break-down by cost centre
117 of the most costly functions in the program. In this case, there
118 was only one significant function in the program, namely
119 <function>nfib</function>, and it was responsible for 100%
120 of both the time and allocation costs of the program.</para>
122 <para>The third and final section of the file gives a profile
123 break-down by cost-centre stack. This is roughly a call-graph
124 profile of the program. In the example above, it is clear that
125 the costly call to <function>nfib</function> came from
126 <function>main</function>.</para>
128 <para>The usefulness of cost-centre stacks is better demonstrated
129 by modifying the example slightly:</para>
132 main = print (f 25 + g 25)
135 nfib n = if n < 2 then 1 else nfib (n-1) + nfib (n-2)
138 <para>Compile and run this program as before, and take a look at
139 the new profiling results:</para>
142 COST CENTRE MODULE scc %time %alloc inner cafs
144 MAIN MAIN 0 0.0 0.0 0 1
145 main Main 0 0.0 0.0 0 1
146 CAF PrelHandle 3 0.0 0.0 0 3
147 CAF PrelAddr 1 0.0 0.0 0 0
148 CAF Main 9 0.0 0.0 1 1
149 main Main 1 0.0 0.0 2 2
151 nfib Main 465 0.0 0.2 464 0
153 nfib Main 242785 100.0 99.8 242784 1
156 <para>Now although we had two calls to <function>nfib</function>
157 in the program, it is immediately clear that it was the call from
158 <function>f</function> which took all the time.</para>
160 <para>The actual meaning of the various columns in the output is:</para>
166 <para>The number of times this particular point in the call
167 graph was entered.</para>
172 <term>%time</term>
174 <para>The percentage of the total run time of the program
175 spent at this point in the call graph.</para>
180 <term>%alloc</term>
182 <para>The percentage of the total memory allocations
183 (excluding profiling overheads) of the program made by this
191 <para>The number of times an inner call-graph context was
192 entered from here (including recursive calls).</para>
199 <para>The number of times a CAF context was entered from
200 here. CAFs are described in <xref
201 linkend="prof-rules">.</para>
206 <para>In addition you can use the <Option>-P</Option> RTS option
207 <indexterm><primary><option>-P</option></primary></indexterm> to
208 get the following additional information:</para>
212 <term><literal>ticks</literal></term>
214 <Para>The raw number of time “ticks” which were
215 attributed to this cost-centre; from this, we get the
216 <literal>%time</literal> figure mentioned
222 <term><literal>bytes</literal></term>
224 <Para>Number of bytes allocated in the heap while in this
225 cost-centre; again, this is the raw number from which we get
226 the <literal>%alloc</literal> figure mentioned
232 <para>What about recursive functions, and mutually recursive
233 groups of functions? Where are the costs attributed? Well,
234 although GHC does keep information about which groups of functions
235 called each other recursively, this information isn't displayed in
236 the basic time and allocation profile, instead the call-graph is
237 flattened into a tree. The XML profiling tool (described in <xref
238 linkend="prof-xml-tool">) will be able to display real loops in
239 the call-graph.</para>
241 <sect2><title>Inserting cost centres by hand</title>
243 <para>Cost centres are just program annotations. When you say
244 <option>-auto-all</option> to the compiler, it automatically
245 inserts a cost centre annotation around every top-level function
246 in your program, but you are entirely free to add the cost
247 centre annotations yourself.</para>
249 <para>The syntax of a cost centre annotation is</para>
252 _scc_ "name" <expression>
255 <para>where <literal>"name"</literal> is an aribrary string,
256 that will become the name of your cost centre as it appears
257 in the profiling output, and
258 <literal><expression></literal> is any Haskell
259 expression. An <literal>_scc_</literal> annotation extends as
260 far to the right as possible when parsing.</para>
264 <sect2 id="prof-rules">
265 <title>Rules for attributing costs</title>
267 <para>The cost of evaluating any expression in your program is
268 attributed to a cost-centre stack using the following rules:</para>
272 <para>If the expression is part of the
273 <firstterm>one-off</firstterm> costs of evaluating the
274 enclosing top-level definition, then costs are attributed to
275 the stack of lexically enclosing <literal>_scc_</literal>
276 annotations on top of the special <literal>CAF</literal>
281 <para>Otherwise, costs are attributed to the stack of
282 lexically-enclosing <literal>_scc_</literal> annotations,
283 appended to the cost-centre stack in effect at the
284 <firstterm>call site</firstterm> of the current top-level
285 definition<footnote> <para>The call-site is just the place
286 in the source code which mentions the particular function or
287 variable.</para></footnote>. Notice that this is a recursive
292 <para>What do we mean by one-off costs? Well, Haskell is a lazy
293 language, and certain expressions are only ever evaluated once.
294 For example, if we write:</para>
300 <para>then <varname>x</varname> will only be evaluated once (if
301 at all), and subsequent demands for <varname>x</varname> will
302 immediately get to see the cached result. The definition
303 <varname>x</varname> is called a CAF (Constant Applicative
304 Form), because it has no arguments.</para>
306 <para>For the purposes of profiling, we say that the expression
307 <literal>nfib 25</literal> belongs to the one-off costs of
308 evaluating <varname>x</varname>.</para>
310 <para>Since one-off costs aren't strictly speaking part of the
311 call-graph of the program, they are attributed to a special
312 top-level cost centre, <literal>CAF</literal>. There may be one
313 <literal>CAF</literal> cost centre for each module (the
314 default), or one for each top-level definition with any one-off
315 costs (this behaviour can be selected by giving GHC the
316 <option>-caf-all</option> flag).</para>
318 <indexterm><primary><literal>-caf-all</literal></primary>
321 <para>If you think you have a weird profile, or the call-graph
322 doesn't look like you expect it to, feel free to send it (and
323 your program) to us at
324 <email>glasgow-haskell-bugs@haskell.org</email>.</para>
329 <sect1 id="prof-heap">
330 <title>Profiling memory usage</title>
332 <para>In addition to profiling the time and allocation behaviour
333 of your program, you can also generate a graph of its memory usage
334 over time. This is useful for detecting the causes of
335 <firstterm>space leaks</firstterm>, when your program holds on to
336 more memory at run-time that it needs to. Space leaks lead to
337 longer run-times due to heavy garbage collector ativity, and may
338 even cause the program to run out of memory altogether.</para>
340 <para>To generate a heap profile from your program, compile it as
341 before, but this time run it with the <option>-h</option> runtime
342 option. This generates a file
343 <filename><prog>.hp</filename> file, which you then process
344 with <command>hp2ps</command> to produce a Postscript file
345 <filename><prog>.ps</filename>. The Postscript file can be
346 viewed with something like <command>ghostview</command>, or
347 printed out on a Postscript-compatible printer.</para>
349 <para>For the RTS options that control the kind of heap profile
350 generated, see <xref linkend="prof-rts-options">. Details on the
351 usage of the <command>hp2ps</command> program are given in <xref
352 linkend="hp2ps"></para>
356 <sect1 id="prof-xml-tool">
357 <title>Graphical time/allocation profile</title>
359 <para>You can view the time and allocation profiling graph of your
360 program graphically, using <command>ghcprof</command>. This is a
361 new tool with GHC 4.07, and will eventually be the de-facto
362 standard way of viewing GHC profiles.</para>
364 <para>To run <command>ghcprof</command>, you need
365 <productname>daVinci</productname> installed, which can be
367 url="http://www.tzi.de/~davinci/"><citetitle>The Graph
368 Visualisation Tool daVinci</citetitle></ulink>. Install one of
370 distributions<footnote><para><productname>daVinci</productname> is
371 sadly not open-source :-(.</para></footnote>, and set your
372 <envar>DAVINCIHOME</envar> environment variable to point to the
373 installation directory.</para>
375 <para><command>ghcprof</command> uses an XML-based profiling log
376 format, and you therefore need to run your program with a
377 different option: <option>-px</option>. The file generated is
378 still called <filename><prog>.prof</filename>. To see the
379 profile, run <command>ghcprof</command> like this:</para>
381 <indexterm><primary><option>-px</option></primary></indexterm>
384 $ ghcprof <prog>.prof
387 <para>which should pop up a window showing the call-graph of your
388 program in glorious detail. More information on using
389 <command>ghcprof</command> can be found at <ulink
390 url="http://www.dcs.warwick.ac.uk/people/academic/Stephen.Jarvis/profiler/index.html"><citetitle>The
391 Cost-Centre Stack Profiling Tool for
392 GHC</citetitle></ulink>.</para>
396 <sect1 id="prof-compiler-options">
397 <title>Compiler options for profiling</title>
399 <indexterm><primary>profiling</primary><secondary>options</secondary></indexterm>
400 <indexterm><primary>options</primary><secondary>for profiling</secondary></indexterm>
402 <Para> To make use of the cost centre profiling system
403 <Emphasis>all</Emphasis> modules must be compiled and linked with
404 the <Option>-prof</Option> option. Any
405 <Function>_scc_</Function> constructs you've put in
406 your source will spring to life.</Para>
408 <indexterm><primary><literal>-prof</literal></primary></indexterm>
410 <Para> Without a <Option>-prof</Option> option, your
411 <Function>_scc_</Function>s are ignored; so you can
412 compiled <Function>_scc_</Function>-laden code
413 without changing it.</Para>
415 <Para>There are a few other profiling-related compilation options.
416 Use them <Emphasis>in addition to</Emphasis>
417 <Option>-prof</Option>. These do not have to be used consistently
418 for all modules in a program.</Para>
423 <term><Option>-auto</Option>:</Term>
424 <indexterm><primary><literal>-auto</literal></primary></indexterm>
425 <indexterm><primary>cost centres</primary><secondary>automatically inserting</secondary></indexterm>
427 <Para> GHC will automatically add
428 <Function>_scc_</Function> constructs for all
429 top-level, exported functions.</Para>
434 <term><Option>-auto-all</Option>:</Term>
435 <indexterm><primary><literal>-auto-all</literal></primary></indexterm>
437 <Para> <Emphasis>All</Emphasis> top-level functions,
438 exported or not, will be automatically
439 <Function>_scc_</Function>'d.</Para>
444 <term><Option>-caf-all</Option>:</Term>
445 <indexterm><primary><literal>-caf-all</literal></primary></indexterm>
447 <Para> The costs of all CAFs in a module are usually
448 attributed to one “big” CAF cost-centre. With
449 this option, all CAFs get their own cost-centre. An
450 “if all else fails” option…</Para>
455 <term><Option>-ignore-scc</Option>:</Term>
456 <indexterm><primary><literal>-ignore-scc</literal></primary></indexterm>
458 <Para>Ignore any <Function>_scc_</Function>
459 constructs, so a module which already has
460 <Function>_scc_</Function>s can be compiled
461 for profiling with the annotations ignored.</Para>
469 <sect1 id="prof-rts-options">
470 <title>Runtime options for profiling</Title>
472 <indexterm><primary>profiling RTS options</primary></indexterm>
473 <indexterm><primary>RTS options, for profiling</primary></indexterm>
475 <Para>It isn't enough to compile your program for profiling with
476 <Option>-prof</Option>!</Para>
478 <Para>When you <Emphasis>run</Emphasis> your profiled program, you
479 must tell the runtime system (RTS) what you want to profile (e.g.,
480 time and/or space), and how you wish the collected data to be
481 reported. You also may wish to set the sampling interval used in
482 time profiling.</Para>
484 <Para>Executive summary: <command>./a.out +RTS -pT</command>
485 produces a time profile in <Filename>a.out.prof</Filename>;
486 <command>./a.out +RTS -hC</command> produces space-profiling info
487 which can be mangled by <command>hp2ps</command> and viewed with
488 <command>ghostview</command> (or equivalent).</Para>
490 <Para>Profiling runtime flags are passed to your program between
491 the usual <Option>+RTS</Option> and <Option>-RTS</Option>
497 <term><Option>-p</Option> or <Option>-P</Option>:</Term>
498 <indexterm><primary><option>-p</option></primary></indexterm>
499 <indexterm><primary><option>-P</option></primary></indexterm>
500 <indexterm><primary>time profile</primary></indexterm>
502 <Para>The <Option>-p</Option> option produces a standard
503 <Emphasis>time profile</Emphasis> report. It is written
505 <Filename><program>.prof</Filename>.</Para>
507 <Para>The <Option>-P</Option> option produces a more
508 detailed report containing the actual time and allocation
509 data as well. (Not used much.)</Para>
514 <term><option>-px</option>:</term>
515 <indexterm><primary><option>-px</option></primary></indexterm>
517 <para>The <option>-px</option> option generates profiling
518 information in the XML format understood by our new
519 profiling tool, see <xref linkend="prof-xml-tool">.</para>
524 <term><Option>-i<secs></Option>:</Term>
525 <indexterm><primary><option>-i</option></primary></indexterm>
527 <Para> Set the profiling (sampling) interval to
528 <literal><secs></literal> seconds (the default is
529 1 second). Fractions are allowed: for example
530 <Option>-i0.2</Option> will get 5 samples per second. This
531 only affects heap profiling; time profiles are always
532 sampled on a 1/50 second frequency.</Para>
537 <term><Option>-h<break-down></Option>:</Term>
538 <indexterm><primary><option>-h<break-down></option></primary></indexterm>
539 <indexterm><primary>heap profile</primary></indexterm>
541 <Para>Produce a detailed <Emphasis>heap profile</Emphasis>
542 of the heap occupied by live closures. The profile is
543 written to the file <Filename><program>.hp</Filename>
544 from which a PostScript graph can be produced using
545 <command>hp2ps</command> (see <XRef
546 LinkEnd="hp2ps">).</Para>
548 <Para>The heap space profile may be broken down by different
554 <term><Option>-hC</Option>:</Term>
556 <Para>cost centre which produced the closure (the
562 <term><Option>-hM</Option>:</Term>
564 <Para>cost centre module which produced the
570 <term><Option>-hD</Option>:</Term>
572 <Para>closure description—a string describing
578 <term><Option>-hY</Option>:</Term>
580 <Para>closure type—a string describing the
581 closure's type.</Para>
590 <term><option>-hx</option>:</term>
591 <indexterm><primary><option>-hx</option></primary></indexterm>
593 <para>The <option>-hx</option> option generates heap
594 profiling information in the XML format understood by our
595 new profiling tool (NOTE: heap profiling with the new tool
596 is not yet working! Use <command>hp2ps</command>-style heap
597 profiling for the time being).</para>
606 <title><command>hp2ps</command>--heap profile to PostScript</title>
608 <indexterm><primary><command>hp2ps</command></primary></indexterm>
609 <indexterm><primary>heap profiles</primary></indexterm>
610 <indexterm><primary>postscript, from heap profiles</primary></indexterm>
611 <indexterm><primary><option>-h<break-down></option></primary></indexterm>
616 hp2ps [flags] [<file>[.hp]]
620 <command>hp2ps</command><indexterm><primary>hp2ps
621 program</primary></indexterm> converts a heap profile as produced
622 by the <Option>-h<break-down></Option> runtime option into a
623 PostScript graph of the heap profile. By convention, the file to
624 be processed by <command>hp2ps</command> has a
625 <filename>.hp</filename> extension. The PostScript output is
626 written to <filename><file>@.ps</filename>. If
627 <filename><file></filename> is omitted entirely, then the
628 program behaves as a filter.</para>
630 <para><command>hp2ps</command> is distributed in
631 <filename>ghc/utils/hp2ps</filename> in a GHC source
632 distribution. It was originally developed by Dave Wakeling as part
633 of the HBC/LML heap profiler.</para>
635 <para>The flags are:</para>
640 <term><Option>-d</Option></Term>
642 <para>In order to make graphs more readable,
643 <command>hp2ps</command> sorts the shaded bands for each
644 identifier. The default sort ordering is for the bands with
645 the largest area to be stacked on top of the smaller ones.
646 The <Option>-d</Option> option causes rougher bands (those
647 representing series of values with the largest standard
648 deviations) to be stacked on top of smoother ones.</para>
653 <term><Option>-b</Option></Term>
655 <para>Normally, <command>hp2ps</command> puts the title of
656 the graph in a small box at the top of the page. However, if
657 the JOB string is too long to fit in a small box (more than
658 35 characters), then <command>hp2ps</command> will choose to
659 use a big box instead. The <Option>-b</Option> option
660 forces <command>hp2ps</command> to use a big box.</para>
665 <term><Option>-e<float>[in|mm|pt]</Option></Term>
667 <para>Generate encapsulated PostScript suitable for
668 inclusion in LaTeX documents. Usually, the PostScript graph
669 is drawn in landscape mode in an area 9 inches wide by 6
670 inches high, and <command>hp2ps</command> arranges for this
671 area to be approximately centred on a sheet of a4 paper.
672 This format is convenient of studying the graph in detail,
673 but it is unsuitable for inclusion in LaTeX documents. The
674 <Option>-e</Option> option causes the graph to be drawn in
675 portrait mode, with float specifying the width in inches,
676 millimetres or points (the default). The resulting
677 PostScript file conforms to the Encapsulated PostScript
678 (EPS) convention, and it can be included in a LaTeX document
679 using Rokicki's dvi-to-PostScript converter
680 <command>dvips</command>.</para>
685 <term><Option>-g</Option></Term>
687 <para>Create output suitable for the <command>gs</command>
688 PostScript previewer (or similar). In this case the graph is
689 printed in portrait mode without scaling. The output is
690 unsuitable for a laser printer.</para>
695 <term><Option>-l</Option></Term>
697 <para>Normally a profile is limited to 20 bands with
698 additional identifiers being grouped into an
699 <literal>OTHER</literal> band. The <Option>-l</Option> flag
700 removes this 20 band and limit, producing as many bands as
701 necessary. No key is produced as it won't fit!. It is useful
702 for creation time profiles with many bands.</para>
707 <term><Option>-m<int></Option></Term>
709 <para>Normally a profile is limited to 20 bands with
710 additional identifiers being grouped into an
711 <literal>OTHER</literal> band. The <Option>-m</Option> flag
712 specifies an alternative band limit (the maximum is
715 <para><Option>-m0</Option> requests the band limit to be
716 removed. As many bands as necessary are produced. However no
717 key is produced as it won't fit! It is useful for displaying
718 creation time profiles with many bands.</para>
723 <term><Option>-p</Option></Term>
725 <para>Use previous parameters. By default, the PostScript
726 graph is automatically scaled both horizontally and
727 vertically so that it fills the page. However, when
728 preparing a series of graphs for use in a presentation, it
729 is often useful to draw a new graph using the same scale,
730 shading and ordering as a previous one. The
731 <Option>-p</Option> flag causes the graph to be drawn using
732 the parameters determined by a previous run of
733 <command>hp2ps</command> on <filename>file</filename>. These
734 are extracted from <filename>file@.aux</filename>.</para>
739 <term><Option>-s</Option></Term>
741 <para>Use a small box for the title.</para>
746 <term><Option>-t<float></Option></Term>
748 <para>Normally trace elements which sum to a total of less
749 than 1% of the profile are removed from the
750 profile. The <option>-t</option> option allows this
751 percentage to be modified (maximum 5%).</para>
753 <para><Option>-t0</Option> requests no trace elements to be
754 removed from the profile, ensuring that all the data will be
760 <term><Option>-?</Option></Term>
762 <para>Print out usage information.</para>
768 <sect1 id="ticky-ticky">
769 <title>Using “ticky-ticky” profiling (for implementors)</Title>
770 <indexterm><primary>ticky-ticky profiling</primary></indexterm>
772 <para>(ToDo: document properly.)</para>
774 <para>It is possible to compile Glasgow Haskell programs so that
775 they will count lots and lots of interesting things, e.g., number
776 of updates, number of data constructors entered, etc., etc. We
777 call this “ticky-ticky”
778 profiling,<indexterm><primary>ticky-ticky
779 profiling</primary></indexterm> <indexterm><primary>profiling,
780 ticky-ticky</primary></indexterm> because that's the sound a Sun4
781 makes when it is running up all those counters
782 (<Emphasis>slowly</Emphasis>).</para>
784 <para>Ticky-ticky profiling is mainly intended for implementors;
785 it is quite separate from the main “cost-centre”
786 profiling system, intended for all users everywhere.</para>
788 <para>To be able to use ticky-ticky profiling, you will need to
789 have built appropriate libraries and things when you made the
790 system. See “Customising what libraries to build,” in
791 the installation guide.</para>
793 <para>To get your compiled program to spit out the ticky-ticky
794 numbers, use a <Option>-r</Option> RTS
795 option<indexterm><primary>-r RTS option</primary></indexterm>.
796 See <XRef LinkEnd="runtime-control">.</para>
798 <para>Compiling your program with the <Option>-ticky</Option>
799 switch yields an executable that performs these counts. Here is a
800 sample ticky-ticky statistics file, generated by the invocation
801 <command>foo +RTS -rfoo.ticky</command>.</para>
807 ALLOCATIONS: 3964631 (11330900 words total: 3999476 admin, 6098829 goods, 1232595 slop)
808 total words: 2 3 4 5 6+
809 69647 ( 1.8%) function values 50.0 50.0 0.0 0.0 0.0
810 2382937 ( 60.1%) thunks 0.0 83.9 16.1 0.0 0.0
811 1477218 ( 37.3%) data values 66.8 33.2 0.0 0.0 0.0
813 2 ( 0.0%) black holes 0.0 100.0 0.0 0.0 0.0
814 0 ( 0.0%) prim things
815 34825 ( 0.9%) partial applications 0.0 0.0 0.0 100.0 0.0
816 2 ( 0.0%) thread state objects 0.0 0.0 0.0 0.0 100.0
818 Total storage-manager allocations: 3647137 (11882004 words)
819 [551104 words lost to speculative heap-checks]
823 ENTERS: 9400092 of which 2005772 (21.3%) direct to the entry code
824 [the rest indirected via Node's info ptr]
825 1860318 ( 19.8%) thunks
826 3733184 ( 39.7%) data values
827 3149544 ( 33.5%) function values
828 [of which 1999880 (63.5%) bypassed arg-satisfaction chk]
829 348140 ( 3.7%) partial applications
830 308906 ( 3.3%) normal indirections
831 0 ( 0.0%) permanent indirections
834 2137257 ( 36.4%) from entering a new constructor
835 [the rest from entering an existing constructor]
836 2349219 ( 40.0%) vectored [the rest unvectored]
838 RET_NEW: 2137257: 32.5% 46.2% 21.3% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0%
839 RET_OLD: 3733184: 2.8% 67.9% 29.3% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0%
840 RET_UNBOXED_TUP: 2: 0.0% 0.0%100.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0%
842 RET_VEC_RETURN : 2349219: 0.0% 0.0%100.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0%
844 UPDATE FRAMES: 2241725 (0 omitted from thunks)
848 0 ( 0.0%) data values
849 34827 ( 1.6%) partial applications
850 [2 in place, 34825 allocated new space]
851 2206898 ( 98.4%) updates to existing heap objects (46 by squeezing)
852 UPD_CON_IN_NEW: 0: 0 0 0 0 0 0 0 0 0
853 UPD_PAP_IN_NEW: 34825: 0 0 0 34825 0 0 0 0 0
855 NEW GEN UPDATES: 2274700 ( 99.9%)
857 OLD GEN UPDATES: 1852 ( 0.1%)
859 Total bytes copied during GC: 190096
861 **************************************************
862 3647137 ALLOC_HEAP_ctr
863 11882004 ALLOC_HEAP_tot
868 34831 ALLOC_FUN_hst_0
869 34816 ALLOC_FUN_hst_1
873 2382937 ALLOC_UP_THK_ctr
876 0 E!NT_PERM_IND_ctr requires +RTS -Z
877 [... lots more info omitted ...]
878 0 GC_SEL_ABANDONED_ctr
881 0 GC_FAILED_PROMOTION_ctr
882 47524 GC_WORDS_COPIED_ctr
885 <para>The formatting of the information above the row of asterisks
886 is subject to change, but hopefully provides a useful
887 human-readable summary. Below the asterisks <Emphasis>all
888 counters</Emphasis> maintained by the ticky-ticky system are
889 dumped, in a format intended to be machine-readable: zero or more
890 spaces, an integer, a space, the counter name, and a newline.</para>
892 <para>In fact, not <Emphasis>all</Emphasis> counters are
893 necessarily dumped; compile- or run-time flags can render certain
894 counters invalid. In this case, either the counter will simply
895 not appear, or it will appear with a modified counter name,
896 possibly along with an explanation for the omission (notice
897 <literal>ENT_PERM_IND_ctr</literal> appears
898 with an inserted <literal>!</literal> above). Software analysing
899 this output should always check that it has the counters it
900 expects. Also, beware: some of the counters can have
901 <Emphasis>large</Emphasis> values!</para>
908 ;;; Local Variables: ***
910 ;;; sgml-parent-document: ("users_guide.sgml" "book" "chapter") ***