Skip to content

Support Yappi for profiling panel #1992

Open
@tim-schilling

Description

@tim-schilling

The current Profiling panel can't support async applications (#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.

Activity

salty-ivy

salty-ivy commented on Nov 12, 2024

@salty-ivy
Member

Since DebugToolbar currently use pstats to represent process profiling data, there’s a compatibility concern. Yappi doesn’t support pstats and instead uses its own format, ystats (reference: Yappi implementation).

tim-schilling

tim-schilling commented on Nov 24, 2024

@tim-schilling
MemberAuthor

@salty-ivy sorry for the late response. There are two options here:

  1. Switch to Yappi entirely
  2. Create a wrapper around ystats and pstats for what we need and use that

Switching to Yappi may be easier. However, 2 may create some portability in the future if another person would like to create a third-party panel that uses a different profiling library.

What are your thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @tim-schilling@salty-ivy

        Issue actions

          Support Yappi for profiling panel · Issue #1992 · django-commons/django-debug-toolbar