27. Debugging and Profiling — Python 3.4.0 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Python »
- 3.4.0 Documentation »
- The Python Standard Library »

# 27. Debugging and Profiling

These libraries help you with Python development: the debugger enables you to step through code, analyze stack frames and set breakpoints etc., and the profilers run code and give you a detailed breakdown of execution times, allowing you to identify bottlenecks in your programs.

- 27.1. `bdb` — Debugger framework
- 27.2. `faulthandler` — Dump the Python traceback
  - 27.2.1. Dump the traceback
  - 27.2.2. Fault handler state
  - 27.2.3. Dump the tracebacks after a timeout
  - 27.2.4. Dump the traceback on a user signal
  - 27.2.5. File descriptor issue
  - 27.2.6. Example
- 27.3. `pdb` — The Python Debugger
  - 27.3.1. Debugger Commands
- 27.4. The Python Profilers
  - 27.4.1. Introduction to the profilers
  - 27.4.2. Instant User’s Manual
  - 27.4.3. `profile` and `cProfile` Module Reference
  - 27.4.4. The `Stats` Class
  - 27.4.5. What Is Deterministic Profiling?
  - 27.4.6. Limitations
  - 27.4.7. Calibration
  - 27.4.8. Using a custom timer
- 27.5. `timeit` — Measure execution time of small code snippets
  - 27.5.1. Basic Examples
  - 27.5.2. Python Interface
  - 27.5.3. Command-Line Interface
  - 27.5.4. Examples
- 27.6. `trace` — Trace or track Python statement execution
  - 27.6.1. Command-Line Usage
    - 27.6.1.1. Main options
    - 27.6.1.2. Modifiers
    - 27.6.1.3. Filters
  - 27.6.2. Programmatic Interface
- 27.7. `tracemalloc` — Trace memory allocations
- 27.8. Examples
  - 27.8.1. Display the top 10
  - 27.8.2. Compute differences
  - 27.8.3. Get the traceback of a memory block
  - 27.8.4. Pretty top
- 27.9. API
  - 27.9.1. Functions
  - 27.9.2. Filter
  - 27.9.3. Frame
  - 27.9.4. Snapshot
  - 27.9.5. Statistic
  - 27.9.6. StatisticDiff
  - 27.9.7. Trace
  - 27.9.8. Traceback

### Navigation

- index
- modules |
- next |
- previous |
- Python »
- 3.4.0 Documentation »
- The Python Standard Library »