summaryrefslogtreecommitdiffstats
path: root/Doc/library/profile.rst
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-04-19 00:55:37 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-04-19 00:55:37 (GMT)
commitdae2a8939df14692b59d66b13c587a0a4197700e (patch)
treec6732b7a9193bc6325d9965ba687278a5d4ce4d5 /Doc/library/profile.rst
parent53876d9cd8a67d9e67772e082deab92a598f74b3 (diff)
downloadcpython-dae2a8939df14692b59d66b13c587a0a4197700e.zip
cpython-dae2a8939df14692b59d66b13c587a0a4197700e.tar.gz
cpython-dae2a8939df14692b59d66b13c587a0a4197700e.tar.bz2
Merged revisions 62350-62355,62358-62359,62364-62365,62370,62372-62375,62378-62379,62381 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r62350 | nick.coghlan | 2008-04-15 12:25:31 +0200 (Tue, 15 Apr 2008) | 1 line Issue 2439: add pkgutils.get_data() as a convenience wrapper for the PEP 302 get_data() API (contributed by Paul Moore) ........ r62351 | nick.coghlan | 2008-04-15 12:28:14 +0200 (Tue, 15 Apr 2008) | 1 line Add test file missing from rev 62350 ........ r62352 | benjamin.peterson | 2008-04-15 13:58:46 +0200 (Tue, 15 Apr 2008) | 2 lines Add myself to Doc/ACKS.txt ........ r62353 | andrew.kuchling | 2008-04-15 15:10:07 +0200 (Tue, 15 Apr 2008) | 6 lines Add *,**,@ to index, as suggested by http://farmdev.com/thoughts/24/what-does-the-def-star-variable-or-def-asterisk-parameter-syntax-do-in-python-/ The right entry type to use isn't clear; operator seems wrong, because *,**,@ aren't being used in expressions here. I put them as 'statement'; 'syntax' might be better. ........ r62354 | andrew.kuchling | 2008-04-15 15:10:41 +0200 (Tue, 15 Apr 2008) | 1 line Typo fix ........ r62355 | mark.dickinson | 2008-04-15 22:51:18 +0200 (Tue, 15 Apr 2008) | 3 lines Fix for possible signed overflow: the behaviour of -LONG_MIN is undefined in ANSI C. ........ r62358 | jeroen.ruigrok | 2008-04-16 14:47:01 +0200 (Wed, 16 Apr 2008) | 2 lines Reformat to 80 columns prior to adding documentation. ........ r62359 | jeroen.ruigrok | 2008-04-16 14:57:43 +0200 (Wed, 16 Apr 2008) | 2 lines Add details about the return value for mmap.flush(). ........ r62364 | raymond.hettinger | 2008-04-17 12:48:31 +0200 (Thu, 17 Apr 2008) | 1 line Issue 2648: Add leading zero to money format recipe in the docs. ........ r62365 | jeroen.ruigrok | 2008-04-17 14:39:45 +0200 (Thu, 17 Apr 2008) | 2 lines Be consistent in the use of read-only. ........ r62370 | andrew.kuchling | 2008-04-17 22:44:06 +0200 (Thu, 17 Apr 2008) | 1 line Typo fixes ........ r62372 | andrew.kuchling | 2008-04-18 04:40:47 +0200 (Fri, 18 Apr 2008) | 1 line Use correct parameter name ........ r62373 | andrew.kuchling | 2008-04-18 18:53:09 +0200 (Fri, 18 Apr 2008) | 1 line #2654: fix typo ........ r62374 | andrew.kuchling | 2008-04-18 20:28:23 +0200 (Fri, 18 Apr 2008) | 4 lines Remove personal note from Jim Roskind; it no longer applies, and the e-mail address is for a previous employer. Can we move the big long copyright statement into a sidebar or something? ........ r62375 | andrew.kuchling | 2008-04-18 20:39:55 +0200 (Fri, 18 Apr 2008) | 1 line Rewrite introductory section, and remove old section. (It was already commented-out, but why keep it?) ........ r62378 | skip.montanaro | 2008-04-18 22:35:46 +0200 (Fri, 18 Apr 2008) | 1 line resolve issue 2014 ........ r62379 | benjamin.peterson | 2008-04-18 22:45:33 +0200 (Fri, 18 Apr 2008) | 2 lines Fix indentation in sysmodule.c ........ r62381 | amaury.forgeotdarc | 2008-04-19 01:31:33 +0200 (Sat, 19 Apr 2008) | 3 lines Some tests did not pass on repeated calls (regrtest -R::) Perform additional cleanup, mostly deleting from sys.modules, or clearing the warnings registry. ........
Diffstat (limited to 'Doc/library/profile.rst')
-rw-r--r--Doc/library/profile.rst86
1 files changed, 23 insertions, 63 deletions
diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst
index 2d46033..c5c69a4 100644
--- a/Doc/library/profile.rst
+++ b/Doc/library/profile.rst
@@ -32,15 +32,6 @@ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-The profiler was written after only programming in Python for 3 weeks. As a
-result, it is probably clumsy code, but I don't know for sure yet 'cause I'm a
-beginner :-). I did work hard to make the code run fast, so that profiling
-would be a reasonable thing to do. I tried not to repeat code fragments, but
-I'm sure I did some stuff in really awkward ways at times. Please send
-suggestions for improvements to: jar@netscape.com. I won't promise *any*
-support. ...but I'd appreciate the feedback.
-
-
.. _profiler-introduction:
Introduction to the profilers
@@ -50,69 +41,38 @@ Introduction to the profilers
single: deterministic profiling
single: profiling, deterministic
-A :dfn:`profiler` is a program that describes the run time performance of a
-program, providing a variety of statistics. This documentation describes the
-profiler functionality provided in the modules :mod:`profile` and :mod:`pstats`.
-This profiler provides :dfn:`deterministic profiling` of any Python programs.
-It also provides a series of report generation tools to allow users to rapidly
+A :dfn:`profiler` is a program that describes the run time performance
+of a program, providing a variety of statistics. This documentation
+describes the profiler functionality provided in the modules
+:mod:`cProfile`, :mod:`profile` and :mod:`pstats`. This profiler
+provides :dfn:`deterministic profiling` of Python programs. It also
+provides a series of report generation tools to allow users to rapidly
examine the results of a profile operation.
The Python standard library provides two different profilers:
-#. :mod:`profile`, a pure Python module, described in the sequel. Copyright ©
- 1994, by InfoSeek Corporation.
+#. :mod:`cProfile` is recommended for most users; it's a C extension
+ with reasonable overhead
+ that makes it suitable for profiling long-running programs.
+ Based on :mod:`lsprof`,
+ contributed by Brett Rosen and Ted Czotter.
-#. :mod:`cProfile`, a module written in C, with a reasonable overhead that makes
- it suitable for profiling long-running programs. Based on :mod:`lsprof`,
- contributed by Brett Rosen and Ted Czotter.
+#. :mod:`profile`, a pure Python module whose interface is imitated by
+ :mod:`cProfile`. Adds significant overhead to profiled programs.
+ If you're trying to extend
+ the profiler in some way, the task might be easier with this module.
+ Copyright © 1994, by InfoSeek Corporation.
The :mod:`profile` and :mod:`cProfile` modules export the same interface, so
-they are mostly interchangeables; :mod:`cProfile` has a much lower overhead but
-is not so far as well-tested and might not be available on all systems.
+they are mostly interchangeable; :mod:`cProfile` has a much lower overhead but
+is newer and might not be available on all systems.
:mod:`cProfile` is really a compatibility layer on top of the internal
+<<<<<<< .working
:mod:`_lsprof` module.
-
-.. \section{How Is This Profiler Different From The Old Profiler?}
- \nodename{Profiler Changes}
-
- (This section is of historical importance only; the old profiler
- discussed here was last seen in Python 1.1.)
-
- The big changes from old profiling module are that you get more
- information, and you pay less CPU time. It's not a trade-off, it's a
- trade-up.
-
- To be specific:
-
- \begin{description}
-
- \item[Bugs removed:]
- Local stack frame is no longer molested, execution time is now charged
- to correct functions.
-
- \item[Accuracy increased:]
- Profiler execution time is no longer charged to user's code,
- calibration for platform is supported, file reads are not done \emph{by}
- profiler \emph{during} profiling (and charged to user's code!).
-
- \item[Speed increased:]
- Overhead CPU cost was reduced by more than a factor of two (perhaps a
- factor of five), lightweight profiler module is all that must be
- loaded, and the report generating module (\module{pstats}) is not needed
- during profiling.
-
- \item[Recursive functions support:]
- Cumulative times in recursive functions are correctly calculated;
- recursive entries are counted.
-
- \item[Large growth in report generating UI:]
- Distinct profiles runs can be added together forming a comprehensive
- report; functions that import statistics take arbitrary lists of
- files; sorting criteria is now based on keywords (instead of 4 integer
- options); reports shows what functions were profiled as well as what
- profile file was referenced; output format has been improved.
-
- \end{description}
+=======
+:mod:`_lsprof` module. The :mod:`hotshot` module is reserved for specialized
+usage.
+>>>>>>> .merge-right.r62379
.. _profile-instant: