Benchmarking

Name Short description 🚦
asv A tool for benchmarking Python packages over their lifetime. Allows you to write benchmarks and then run them against every commit in the repository, to identify where performance increased or decreased. Comparative benchmarks can also be run, which can be useful for running them in CI using GitHub runners. Best

Profiling

Time

Name Short description 🚦
pyinstrument Python profiler. Tells you how long individual lines of code take to run, so you can focus on the slowest part of your program to speed it up. Best
line_profiler A tool for line-by-line profiling of functions. Good

Memory

Name Short description 🚦
memray Tracks and reports memory allocations, both in Python code and in compiled extension modules. It also has a plugin for easy integration with pytest. Only works on Linux and macOS. Good
memory_profiler No longer actively maintained. A Python module for monitoring memory consumption of a process alongside line-by-line analysis of memory consumption. Might be a useful alternative to memray if you need to do memory profiling on Windows. Good

General/other tools

Name Short description 🚦
psutil System monitoring, profiling, limiting process resources and the management of running processes. Best
snakeviz Browser based graphical viewer for the output of Python’s cProfile module. Best