profile

Stdlib — ProfilingPython 2.0+Intermediate

Pure-Python profiler (slower but extensible)

Quick Info

Documentation
Official Docs
Python Version
2.0+
Dependencies
None — Python Standard Library
Install
Included with Python

Learn by Difficulty

Quick Example

python
import cProfile

def slow_function():
    total = 0
    for i in range(10000):
        total += i ** 2
    return total

cProfile.run("slow_function()")

The profile module is part of Python's standard library. Pure-Python profiler (slower but extensible).

Try in Playground

Tags

stdlibprofilingperformance