PyCharm
 
Get PyCharm
You are viewing the documentation for an earlier version of PyCharm.

Optimize your code using profilers

Last modified: 07 September 2023

PyCharm allows running the current run/debug configuration while attaching a Python profiler to it. Note that the Diagrams plugin that is bundled with PyCharm should be enabled.

If you have a yappi profiler installed on your interpreter, PyCharm starts the profiling session with it by default, otherwise it uses the standard cProfile profiler.

Besides these two tracing profilers, PyCharm supports also sampling (statistical) profiler vmprof, which should be installed on the selected Python interpreter. If you are Windows 64 bit user, you have to install Python 32 bit, to make vmprof work. Install 32-bit Python as described on the page Python Releases for Windows.

A profiler runs in the following order: vmprof, yappi, cProfile.