Skip to content

Remove some code that uses the preview filtered thread#5336

Merged
mstange merged 5 commits into
firefox-devtools:mainfrom
mstange:remove-some-preview-filtered-thread-deps
Jan 20, 2025
Merged

Remove some code that uses the preview filtered thread#5336
mstange merged 5 commits into
firefox-devtools:mainfrom
mstange:remove-some-preview-filtered-thread-deps

Conversation

@mstange

@mstange mstange commented Jan 19, 2025

Copy link
Copy Markdown
Contributor

I haven't seen it show up as a performance problem, but it's a bit silly that we create a new samples table every time the preview selection changes. It should be possible to just ignore samples outside the range.

This PR doesn't actually get rid of the preview filtered thread, but it moves some things around so that such a change would be easier to make in the future.

@mstange mstange requested a review from julienw January 19, 2025 20:54
@codecov

codecov Bot commented Jan 19, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.07%. Comparing base (5431546) to head (eda833f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5336      +/-   ##
==========================================
- Coverage   86.08%   86.07%   -0.02%     
==========================================
  Files         311      311              
  Lines       29687    29645      -42     
  Branches     8192     8194       +2     
==========================================
- Hits        25557    25516      -41     
+ Misses       3548     3547       -1     
  Partials      582      582              

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

@julienw julienw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good to me.
Only commit Remove getFilteredCallNodeMaxDepthPlusOne I'm not so sure. Tell me what you think!

} = this.props;

const maxViewportHeight = maxStackDepthPlusOne * STACK_FRAME_HEIGHT;
const maxViewportHeight = combinedTimingRows.length * STACK_FRAME_HEIGHT;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, I just checked that we were clipping off some rows when showing user timing marker rows

Comment thread src/components/calltree/CallTree.js Outdated
// selections.
callNodeMaxDepthPlusOne:
selectedThreadSelectors.getFilteredCallNodeMaxDepthPlusOne(state),
selectedThreadSelectors.getCallNodeMaxDepthPlusOne(state),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure of the changes in this commit (Remove getFilteredCallNodeMaxDepthPlusOne. ).

  1. It's not a commit that removes code that uses the preview filtered thread.
  2. in some situations it makes it possible to scroll down in the stack chart or up in the flame graph in the white space. We could already do that before with a preview selection but not with a committed range.

I could live with but wanted to ask your opinion before that, to know if this was expected by you.

See for example:

production / deploy preview
(also try the stack chart with these links)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. This behavior difference was expected by me but I your example is somewhat convincing that the new behavior is worse. I'll just remove this commit.

Thanks for doing the work to find an example!

Hopefully nobody was relying on the fact that the sample data
in window.filteredThread was taking the preview selection into
account.
I think we were clipping off some rows if there were user timing marker rows.
…thread.

CallTree doesn't look at the samples table of the thread, it just
looks at funcTable / resourceTable / stringTable etc.

For sample data, we pass the CTSS samples to it separately.

So it's fine to pass the filtered thread to the CallTree.
@mstange mstange force-pushed the remove-some-preview-filtered-thread-deps branch from eda833f to 3c90f66 Compare January 20, 2025 18:21
@mstange mstange enabled auto-merge January 20, 2025 18:22
@mstange mstange merged commit f07cfdc into firefox-devtools:main Jan 20, 2025
@canova canova mentioned this pull request Jan 30, 2025
canova added a commit that referenced this pull request Jan 30, 2025
Updates:

[Julien Wajsberg] Some more small refactorings (#5320)
[Markus Stange] Pass the correct sample index offset to
getTimingsForCallNodeIndex for the flame graph tooltip. (#5328)
[Nisarg Jhaveri] Update docs to include Android Studio/Simpleperf trace
file support (#5309)
[Markus Stange] Don't pass the preview filtered thread to
getTimingsForPath/CallNodeIndex. (#5329)
[Nazım Can Altınova] Add a "Sample timestamp" field to the sample
tooltip in timeline (#5322)
[Markus Stange] Reduce confusion between call tree summary strategy
aware samples and regular samples (#5330)
[Markus Stange] Rename this getCounter selector to getCounters. (#5337)
[Markus Stange] Make sample indexes compatible between the unfiltered
and (preview) filtered call tree summary strategy samples when using an
allocation strat>
[Markus Stange] Remove some code that uses the preview filtered thread
(#5336)
[Markus Stange] Remove getMarkerSchemaName special cases - look up
marker schemas from data.type and nothing else (#5293)
[Markus Stange] Remove the makeProfileSerializable step - make the raw
in-memory profile match the format that's stored in the file (#5287)
[Nicolas Chevobbe] Adapt FilterNavigatorBar to High Contrast Mode.
(#5257)
[Nicolas Chevobbe] Adapt Tracks to High Contrast Mode. (#5252)
[Markus Stange] Adjust string index fields in markers when merging
threads (#5344)
[Theodoros Nikolaou] Localize title and aria label in ProfileName
(#5345)
[Julien Wajsberg] Adapt time-slice selection in High Contrast Mode.
(#5259)
[Markus Stange] Make stackTable (sub)category derived data (#5342)
[Markus Stange] Compute cpuRatio values when computing the derived
thread (#5288)
[Nazım Can Altınova] Add a context menu item to open the JS scripts in
DevTools debugger (#5295)

Also thanks to our localizers:

el: Jim Spentzos
fr: Théo Chevalier
it: Francesco Lodolo [:flod]
zh-TW: Pin-guang Chen
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