django-commons / django-debug-toolbar

A configurable set of panels that display various debug information about the current request/response.
https://django-debug-toolbar.readthedocs.io
BSD 3-Clause "New" or "Revised" License
8.08k stars 1.05k forks source link

Support Yappi for profiling panel #1992

Open tim-schilling opened 2 months ago

tim-schilling commented 2 months ago

The current Profiling panel can't support async applications (https://github.com/jazzband/django-debug-toolbar/issues/1875). However, the yappi project does https://github.com/sumerc/yappi

It's been around for >5 years, it's the default profiler for PyCharm and it supports multi-threaded applications.

We could make this an optional dependency of the toolbar and could try to automatically utilize it if we're in async context. I haven't thought it entirely through, but I wanted to highlight there are async profiling options available to us. And since profiling is disabled by default, I'd be okay with adding an optional dependency to support it.