| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="lib.html" title='Python Library Reference' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='index' href='genindex.html' title='Index' /> |
| 10 | <link rel='last' href='about.html' title='About this document...' /> |
| 11 | <link rel='help' href='about.html' title='About this document...' /> |
| 12 | <link rel="next" href="module-timeit.html" /> |
| 13 | <link rel="prev" href="node458.html" /> |
| 14 | <link rel="parent" href="profile.html" /> |
| 15 | <link rel="next" href="hotshot-objects.html" /> |
| 16 | <meta name='aesop' content='information' /> |
| 17 | <title>10.9 hotshot -- High performance logging profiler</title> |
| 18 | </head> |
| 19 | <body> |
| 20 | <DIV CLASS="navigation"> |
| 21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 23 | <tr> |
| 24 | <td class='online-navigation'><a rel="prev" title="10.8 Extensions " |
| 25 | href="node458.html"><img src='../icons/previous.png' |
| 26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 27 | <td class='online-navigation'><a rel="parent" title="10. The Python Profiler" |
| 28 | href="profile.html"><img src='../icons/up.png' |
| 29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 30 | <td class='online-navigation'><a rel="next" title="10.9.1 Profile Objects" |
| 31 | href="hotshot-objects.html"><img src='../icons/next.png' |
| 32 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 33 | <td align="center" width="100%">Python Library Reference</td> |
| 34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 35 | href="contents.html"><img src='../icons/contents.png' |
| 36 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 38 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 39 | <td class='online-navigation'><a rel="index" title="Index" |
| 40 | href="genindex.html"><img src='../icons/index.png' |
| 41 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 42 | </tr></table> |
| 43 | <div class='online-navigation'> |
| 44 | <b class="navlabel">Previous:</b> |
| 45 | <a class="sectref" rel="prev" href="node458.html">10.8 Extensions </A> |
| 46 | <b class="navlabel">Up:</b> |
| 47 | <a class="sectref" rel="parent" href="profile.html">10. The Python Profiler</A> |
| 48 | <b class="navlabel">Next:</b> |
| 49 | <a class="sectref" rel="next" href="hotshot-objects.html">10.9.1 Profile Objects</A> |
| 50 | </div> |
| 51 | <hr /></div> |
| 52 | </DIV> |
| 53 | <!--End of Navigation Panel--> |
| 54 | |
| 55 | <H1><A NAME="SECTION0012900000000000000000"> |
| 56 | 10.9 <tt class="module">hotshot</tt> -- |
| 57 | High performance logging profiler</A> |
| 58 | </H1> |
| 59 | |
| 60 | <P> |
| 61 | <A NAME="module-hotshot"></A> |
| 62 | |
| 63 | <P> |
| 64 | |
| 65 | <span class="versionnote">New in version 2.2.</span> |
| 66 | |
| 67 | <P> |
| 68 | This module provides a nicer interface to the <tt class="module">_hotshot</tt> C module. |
| 69 | Hotshot is a replacement for the existing <tt class="module"><a href="module-profile.html">profile</a></tt> module. As it's |
| 70 | written mostly in C, it should result in a much smaller performance impact |
| 71 | than the existing <tt class="module"><a href="module-profile.html">profile</a></tt> module. |
| 72 | |
| 73 | <P> |
| 74 | <div class="warning"><b class="label">Warning:</b> |
| 75 | |
| 76 | The <tt class="module">hotshot</tt> profiler does not yet work well with threads. |
| 77 | It is useful to use an unthreaded script to run the profiler over |
| 78 | the code you're interested in measuring if at all possible. |
| 79 | </div> |
| 80 | |
| 81 | <P> |
| 82 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 83 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3122' xml:id='l2h-3122' class="class">Profile</tt></b>(</nobr></td> |
| 84 | <td><var>logfile</var><big>[</big><var>, lineevents</var><big>[</big><var>, |
| 85 | linetimings</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt> |
| 86 | <dd> |
| 87 | The profiler object. The argument <var>logfile</var> is the name of a log |
| 88 | file to use for logged profile data. The argument <var>lineevents</var> |
| 89 | specifies whether to generate events for every source line, or just on |
| 90 | function call/return. It defaults to <code>0</code> (only log function |
| 91 | call/return). The argument <var>linetimings</var> specifies whether to |
| 92 | record timing information. It defaults to <code>1</code> (store timing |
| 93 | information). |
| 94 | </dl> |
| 95 | |
| 96 | <P> |
| 97 | |
| 98 | <p><br /></p><hr class='online-navigation' /> |
| 99 | <div class='online-navigation'> |
| 100 | <!--Table of Child-Links--> |
| 101 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a> |
| 102 | |
| 103 | <UL CLASS="ChildLinks"> |
| 104 | <LI><A href="hotshot-objects.html">10.9.1 Profile Objects</a> |
| 105 | <LI><A href="module-hotshot.stats.html">10.9.2 Using hotshot data</a> |
| 106 | <LI><A href="hotshot-example.html">10.9.3 Example Usage</a> |
| 107 | </ul> |
| 108 | <!--End of Table of Child-Links--> |
| 109 | </div> |
| 110 | |
| 111 | <DIV CLASS="navigation"> |
| 112 | <div class='online-navigation'> |
| 113 | <p></p><hr /> |
| 114 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 115 | <tr> |
| 116 | <td class='online-navigation'><a rel="prev" title="10.8 Extensions " |
| 117 | href="node458.html"><img src='../icons/previous.png' |
| 118 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 119 | <td class='online-navigation'><a rel="parent" title="10. The Python Profiler" |
| 120 | href="profile.html"><img src='../icons/up.png' |
| 121 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 122 | <td class='online-navigation'><a rel="next" title="10.9.1 Profile Objects" |
| 123 | href="hotshot-objects.html"><img src='../icons/next.png' |
| 124 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 125 | <td align="center" width="100%">Python Library Reference</td> |
| 126 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 127 | href="contents.html"><img src='../icons/contents.png' |
| 128 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 129 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 130 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 131 | <td class='online-navigation'><a rel="index" title="Index" |
| 132 | href="genindex.html"><img src='../icons/index.png' |
| 133 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 134 | </tr></table> |
| 135 | <div class='online-navigation'> |
| 136 | <b class="navlabel">Previous:</b> |
| 137 | <a class="sectref" rel="prev" href="node458.html">10.8 Extensions </A> |
| 138 | <b class="navlabel">Up:</b> |
| 139 | <a class="sectref" rel="parent" href="profile.html">10. The Python Profiler</A> |
| 140 | <b class="navlabel">Next:</b> |
| 141 | <a class="sectref" rel="next" href="hotshot-objects.html">10.9.1 Profile Objects</A> |
| 142 | </div> |
| 143 | </div> |
| 144 | <hr /> |
| 145 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 146 | </DIV> |
| 147 | <!--End of Navigation Panel--> |
| 148 | <ADDRESS> |
| 149 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 150 | </ADDRESS> |
| 151 | </BODY> |
| 152 | </HTML> |