rest25/library/hotshot.rst => rest262/library/hotshot.rst
13This module provides a nicer interface to the :mod:`_hotshot` C module. Hotshot
14is a replacement for the existing :mod:`profile` module. As it's written mostly
15in C, it should result in a much smaller performance impact than the existing
16:mod:`profile` module.
17
18.. note::
19
20   The :mod:`hotshot` module focuses on minimizing the overhead while profiling, at
n21-   the expense of long data post-processing times. For common usages it is
n21+   the expense of long data post-processing times. For common usage it is
22   recommended to use :mod:`cProfile` instead. :mod:`hotshot` is not maintained and
23   might be removed from the standard library in the future.
24
25.. versionchanged:: 2.5
n26-   the results should be more meaningful than in the past: the timing core
n26+   The results should be more meaningful than in the past: the timing core
27   contained a critical bug.
28
29.. warning::
30
31   The :mod:`hotshot` profiler does not yet work well with threads. It is useful to
32   use an unthreaded script to run the profiler over the code you're interested in
33   measuring if at all possible.
34
46.. _hotshot-objects:
47
48Profile Objects
49---------------
50
51Profile objects have the following methods:
52
53
n54-.. method:: XXX Class.addinfo(key, value)
n54+.. method:: Profile.addinfo(key, value)
55
56   Add an arbitrary labelled value to the profile output.
57
58
n59-.. method:: XXX Class.close()
n59+.. method:: Profile.close()
60
61   Close the logfile and terminate the profiler.
62
63
n64-.. method:: XXX Class.fileno()
n64+.. method:: Profile.fileno()
65
66   Return the file descriptor of the profiler's log file.
67
68
n69-.. method:: XXX Class.run(cmd)
n69+.. method:: Profile.run(cmd)
70
71   Profile an :keyword:`exec`\ -compatible string in the script environment. The
72   globals from the :mod:`__main__` module are used as both the globals and locals
73   for the script.
74
75
n76-.. method:: XXX Class.runcall(func, *args, **keywords)
n76+.. method:: Profile.runcall(func, *args, **keywords)
77
78   Profile a single call of a callable. Additional positional and keyword arguments
79   may be passed along; the result of the call is returned, and exceptions are
80   allowed to propagate cleanly, while ensuring that profiling is disabled on the
81   way out.
82
83
n84-.. method:: XXX Class.runctx(cmd, globals, locals)
n84+.. method:: Profile.runctx(cmd, globals, locals)
85
86   Evaluate an :keyword:`exec`\ -compatible string in a specific environment. The
87   string is compiled before profiling begins.
88
89
n90-.. method:: XXX Class.start()
n90+.. method:: Profile.start()
91
92   Start the profiler.
93
94
t95-.. method:: XXX Class.stop()
t95+.. method:: Profile.stop()
96
97   Stop the profiler.
98
99
100Using hotshot data
101------------------
102
103.. module:: hotshot.stats
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op