Skip to content

Update profiling panel to use an absolute cumtime comparison. - #2447

Open
tim-schilling wants to merge 3 commits into
mainfrom
profiling-panel
Open

Update profiling panel to use an absolute cumtime comparison.#2447
tim-schilling wants to merge 3 commits into
mainfrom
profiling-panel

Conversation

@tim-schilling

Copy link
Copy Markdown
Member

Description

This reworks ProfilingPanel to contain a dedicated method to manage whether a function call should be included in the profiling stats results. This moves the depth down to allow developers to customize this at the expense of duplicating the comparison. It also uses the aggregate timing values rather than an individual callers timings. This is what truly fixes #2209. This also revealed that all_callees was a graph. This meant that function calls may appear more than once and would need to be skipped since we've already aggregated those times. It appears this also helps with #1004 (I was able to turn the max depth up way higher than usual).

This retires PROFILER_THRESHOLD_RATIO as it didn't work super well.

Fixes #2209

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

AI/LLM Usage

  • This PR includes code generated with the help of an AI/LLM

I used Claude to determine why pStats was able to collect data differently than our implementation.

This reworks ProfilingPanel to contain a dedicated method to manage
whether a function call should be included in the profiling stats results.
This moves the depth down to allow developers to customize this at the
expense of duplicating the comparison.

This retires PROFILER_THRESHOLD_RATIO as it didn't work super well.
The all_callees is a graph data structure and needs to be traversed entirely
to reconstruct the callers tree. This is why we need to skip subsequent nodes
since the time was already aggregated into the first call appearance.
@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 98.36% 60 / 61
🔵 Statements 98.38% 61 / 62
🔵 Functions 100% 17 / 17
🔵 Branches 68.75% 11 / 16
File CoverageNo changed files found.
Generated in workflow #3387 for commit bd79343 by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  debug_toolbar/panels
  profiling.py
Project Total  

This report was generated by python-coverage-comment-action

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profiling panel isn't as helpful as pStats

1 participant