ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH

Reference
ActivePython 2.5
Python Documentation
Library Reference
25. The Python Profilers
25.1 Introduction to the profilers
25.2 Instant User's Manual
25.3 What Is Deterministic Profiling?
25.4 Reference Manual - profile and cProfile
25.5 Limitations
25.6 Calibration
25.7 Extensions -- Deriving Better Profilers
25.8 hotshot -- High performance logging profiler
25.9 timeit -- Measure execution time of small code snippets
25.10 trace -- Trace or track Python statement execution

MyASPN >> Reference >> ActivePython 2.5 >> Python Documentation >> Library Reference >> 25. The Python Profilers
ActivePython 2.5 documentation

25.1 Introduction to the profilers

A 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 profile and pstats. This profiler provides deterministic profiling of any 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 three different profilers:

  1. profile, a pure Python module, described in the sequel. Copyright © 1994, by InfoSeek Corporation. Changed in version 2.4: also reports the time spent in calls to built-in functions and methods.

  2. cProfile, a module written in C, with a reasonable overhead that makes it suitable for profiling long-running programs. Based on lsprof, contributed by Brett Rosen and Ted Czotter. New in version 2.5.

  3. hotshot, a C module focusing on minimizing the overhead while profiling, at the expense of long data post-processing times. Changed in version 2.5: the results should be more meaningful than in the past: the timing core contained a critical bug.

The profile and cProfile modules export the same interface, so they are mostly interchangeables; cProfile has a much lower overhead but is not so far as well-tested and might not be available on all systems. cProfile is really a compatibility layer on top of the internal _lsprof module. The hotshot module is reserved to specialized usages.

See About this document... for information on suggesting changes.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved