| 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="profile-calibration.html" /> |
| 13 | <link rel="prev" href="module-profile.html" /> |
| 14 | <link rel="parent" href="profile.html" /> |
| 15 | <link rel="next" href="profile-calibration.html" /> |
| 16 | <meta name='aesop' content='information' /> |
| 17 | <title>10.6 Limitations </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.5.1 The Stats Class" |
| 25 | href="profile-stats.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.7 Calibration" |
| 31 | href="profile-calibration.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="profile-stats.html">10.5.1 The Stats Class</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="profile-calibration.html">10.7 Calibration</A> |
| 50 | </div> |
| 51 | <hr /></div> |
| 52 | </DIV> |
| 53 | <!--End of Navigation Panel--> |
| 54 | |
| 55 | <H1><A NAME="SECTION0012600000000000000000"></A><A NAME="profile-limits"></A> |
| 56 | <BR> |
| 57 | 10.6 Limitations |
| 58 | </H1> |
| 59 | |
| 60 | <P> |
| 61 | One limitation has to do with accuracy of timing information. |
| 62 | There is a fundamental problem with deterministic profilers involving |
| 63 | accuracy. The most obvious restriction is that the underlying ``clock'' |
| 64 | is only ticking at a rate (typically) of about .001 seconds. Hence no |
| 65 | measurements will be more accurate than the underlying clock. If |
| 66 | enough measurements are taken, then the ``error'' will tend to average |
| 67 | out. Unfortunately, removing this first error induces a second source |
| 68 | of error. |
| 69 | |
| 70 | <P> |
| 71 | The second problem is that it ``takes a while'' from when an event is |
| 72 | dispatched until the profiler's call to get the time actually |
| 73 | <em>gets</em> the state of the clock. Similarly, there is a certain lag |
| 74 | when exiting the profiler event handler from the time that the clock's |
| 75 | value was obtained (and then squirreled away), until the user's code |
| 76 | is once again executing. As a result, functions that are called many |
| 77 | times, or call many functions, will typically accumulate this error. |
| 78 | The error that accumulates in this fashion is typically less than the |
| 79 | accuracy of the clock (less than one clock tick), but it |
| 80 | <em>can</em> accumulate and become very significant. This profiler |
| 81 | provides a means of calibrating itself for a given platform so that |
| 82 | this error can be probabilistically (on the average) removed. |
| 83 | After the profiler is calibrated, it will be more accurate (in a least |
| 84 | square sense), but it will sometimes produce negative numbers (when |
| 85 | call counts are exceptionally low, and the gods of probability work |
| 86 | against you :-). ) Do <em>not</em> be alarmed by negative numbers in |
| 87 | the profile. They should <em>only</em> appear if you have calibrated |
| 88 | your profiler, and the results are actually better than without |
| 89 | calibration. |
| 90 | |
| 91 | <P> |
| 92 | |
| 93 | <DIV CLASS="navigation"> |
| 94 | <div class='online-navigation'> |
| 95 | <p></p><hr /> |
| 96 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 97 | <tr> |
| 98 | <td class='online-navigation'><a rel="prev" title="10.5.1 The Stats Class" |
| 99 | href="profile-stats.html"><img src='../icons/previous.png' |
| 100 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 101 | <td class='online-navigation'><a rel="parent" title="10. The Python Profiler" |
| 102 | href="profile.html"><img src='../icons/up.png' |
| 103 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 104 | <td class='online-navigation'><a rel="next" title="10.7 Calibration" |
| 105 | href="profile-calibration.html"><img src='../icons/next.png' |
| 106 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 107 | <td align="center" width="100%">Python Library Reference</td> |
| 108 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 109 | href="contents.html"><img src='../icons/contents.png' |
| 110 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 111 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 112 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 113 | <td class='online-navigation'><a rel="index" title="Index" |
| 114 | href="genindex.html"><img src='../icons/index.png' |
| 115 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 116 | </tr></table> |
| 117 | <div class='online-navigation'> |
| 118 | <b class="navlabel">Previous:</b> |
| 119 | <a class="sectref" rel="prev" href="profile-stats.html">10.5.1 The Stats Class</A> |
| 120 | <b class="navlabel">Up:</b> |
| 121 | <a class="sectref" rel="parent" href="profile.html">10. The Python Profiler</A> |
| 122 | <b class="navlabel">Next:</b> |
| 123 | <a class="sectref" rel="next" href="profile-calibration.html">10.7 Calibration</A> |
| 124 | </div> |
| 125 | </div> |
| 126 | <hr /> |
| 127 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 128 | </DIV> |
| 129 | <!--End of Navigation Panel--> |
| 130 | <ADDRESS> |
| 131 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 132 | </ADDRESS> |
| 133 | </BODY> |
| 134 | </HTML> |