Skip to content

Add "drop samples with category" transform#5943

Draft
canova wants to merge 1 commit intofirefox-devtools:mainfrom
canova:drop-category-transform
Draft

Add "drop samples with category" transform#5943
canova wants to merge 1 commit intofirefox-devtools:mainfrom
canova:drop-category-transform

Conversation

@canova
Copy link
Copy Markdown
Member

@canova canova commented Apr 10, 2026

This is useful for cases where I want to drop all the "idle" category samples, so I can focus on non-idle samples. Or it can be useful for dropping the whole profiler overhead by removing the "profiler" category.

I would like to use this transform in the pq cli tool, so we can remove the idle category before finding the "top functions". Otherwise the idle category just pollutes the output of the cli a lot.

Example profile: deploy preview
Use the drop samples with category transform on the idle category above.

@canova canova requested a review from mstange April 10, 2026 11:02
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 88.63636% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.39%. Comparing base (2a7d07e) to head (b9dd201).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/profile-logic/transforms.ts 90.62% 3 Missing ⚠️
src/components/shared/CallNodeContextMenu.tsx 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5943   +/-   ##
=======================================
  Coverage   85.38%   85.39%           
=======================================
  Files         322      322           
  Lines       32099    32143   +44     
  Branches     8840     8858   +18     
=======================================
+ Hits        27408    27448   +40     
- Misses       4260     4263    +3     
- Partials      431      432    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mstange
Copy link
Copy Markdown
Contributor

mstange commented Apr 10, 2026

Hmm, in the deploy preview, if I drop samples with category JavaScript, it also drops samples with category DOM where the stack contains a JS function.

@canova
Copy link
Copy Markdown
Member Author

canova commented Apr 10, 2026

Oh, I'm currently removing all the samples if they contain the category anywhere in their stack. It makes more sense to drop them if that category is the leaf only.

@canova canova force-pushed the drop-category-transform branch from 049e78d to 3d480ef Compare April 10, 2026 15:56
@canova
Copy link
Copy Markdown
Member Author

canova commented Apr 10, 2026

I guess I was following how drop-function does, and it also drops the samples if any of the frame in the stack contains it. I updated the code to look at leaf only now. Is it better?

@canova canova force-pushed the drop-category-transform branch from 3d480ef to ccc3c7c Compare April 10, 2026 15:58
@mstange
Copy link
Copy Markdown
Contributor

mstange commented Apr 10, 2026

It's definitely more in line with my expectations. But now it's a bit confusing that you apply the filter by clicking a call node which will often still be there even with the filter applied. But maybe it's good enough.

This is useful for cases where I want to drop all the "idle" category
samples, so I can focus on non-idle samples. Or it can be useful for
dropping the whole profiler overhead by removing the "profiler"
category.

I would like to use this transform in the pq cli tool, so we can remove
the idle category before finding the "top functions". Otherwise the idle
category just pollutes the output of the cli a lot.
@canova canova force-pushed the drop-category-transform branch from ccc3c7c to b9dd201 Compare April 10, 2026 16:11
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.

2 participants