Profiling Python code#
Name | Scope | web framework middleware | VSCode Extension |
---|---|---|---|
scalene | cpu, gpu, memory, duration | partially | yes |
cProfile (Python native, function level only and cli only) | duration | no | no |
VizTracer | duration | unknown | yes |
profyle (based on Viztracer) | duration | yes | no |
pyinstrument | duration | yes | no |
py-spy | duration | no | no |
yappi (cli only) | duration | unknown | no |
austin | duration | unknown | yes |
Interesting reading:
- [2023] Profiling in Python: How to Find Performance Bottlenecks
- [2023][Podcast] Measuring Multiple Facets of Python Performance With Scalene
- [2019][PDF] A Survey of Open-Source Python Profilers by Peter Norton
- [2020] Why you should try VizTracer to understand your python program
- [2023] How to Profile Asyncio Programs with cProfile