Comments (8)
What is a "heavy callstack"?
from profiler.
The "heaviest" callstack is the stack with the highest number of samples in it. Not sure why I said "heavy" instead of "heaviest" when I filed the bug.
My current thinking is that we should find the heaviest callstack, and then select the leafmost frame in it that has a different category from its parent frame.
from profiler.
I'm not sure I would actually want this if I already have something I've already selected. Do you want to keep this open @mstange ?
from profiler.
Yes, I still think this would be a good change.
from profiler.
This is a screenshot of the markers being referenced in this bug:
And here is generally how the code should start to look for this patch:
diff --git a/src/actions/profile-view.js b/src/actions/profile-view.js
index b1e6a745..eb19b2d5 100644
--- a/src/actions/profile-view.js
+++ b/src/actions/profile-view.js
@@ -212,6 +212,16 @@ export function updateProfileSelection(selection: ProfileSelection): Action {
};
}
+export function selectHeaviestCallNodeInSelection(): ThunkAction {
+ return (dispatch, getState) => {
+ // Get the call tree, and find the heaviest sample.
+ // Then computed the expandedCallNodePath and selectedCallNode
+
+ dispatch(changeSelectedCallNode( ... ));
+ dispatch(changeExpandedCallNodes( ... ));
+ };
+}
+
export function addRangeFilter(start: number, end: number): Action {
return {
type: 'ADD_RANGE_FILTER',
diff --git a/src/components/header/ProfileThreadHeaderBar.js b/src/components/header/ProfileThreadHeaderBar.js
index c2c698e7..08fdc56b 100644
--- a/src/components/header/ProfileThreadHeaderBar.js
+++ b/src/components/header/ProfileThreadHeaderBar.js
@@ -27,7 +27,10 @@ import type {
} from '../../types/profile-derived';
import type { State } from '../../types/reducers';
-import { updateProfileSelection } from '../../actions/profile-view';
+import {
+ updateProfileSelection,
+ selectHeaviestCallNodeInSelection,
+} from '../../actions/profile-view';
type Props = {
threadIndex: ThreadIndex,
@@ -45,6 +48,7 @@ type Props = {
processDetails: string,
changeSelectedThread: ThreadIndex => void,
updateProfileSelection: typeof updateProfileSelection,
+ selectHeaviestCallNodeInSelection: typeof selectHeaviestCallNodeInSelection,
changeSelectedCallNode: (IndexIntoCallNodeTable, CallNodePath) => void,
};
@@ -106,14 +110,16 @@ class ProfileThreadHeaderBar extends PureComponent<Props> {
rangeEnd,
updateProfileSelection,
changeSelectedThread,
+ selectHeaviestCallNodeInSelection,
} = this.props;
+ changeSelectedThread(threadIndex);
updateProfileSelection({
hasSelection: true,
isModifying: false,
selectionStart: Math.max(rangeStart, start),
selectionEnd: Math.min(rangeEnd, end),
});
- changeSelectedThread(threadIndex);
+ selectHeaviestCallNodeInSelection();
}
_onMarkerSelect(/* markerIndex */) {}
from profiler.
@mstange To clarify what you're saying, would the heaviest stack be the node in the call tree with the largest self time?
from profiler.
It should do something very similar to what this does:
That is, it should expand the path "along the top" of the tree up to a certain depth. That's usually the part of the tree that I'm interested in when I click a marker.
from profiler.
Removing "help wanted" because this seems a bit complicated for contributors. Not sure how to move that forward though...
from profiler.
Related Issues (20)
- Add a short section that explains how to share a profile to the homepage
- Profiling sources of JS garbage no longer works? HOT 4
- Loading this profile is too slow HOT 1
- Document power profiling
- There is a gap between the JavaScript radio button and its label HOT 1
- When lots of functions are dropped, they're not easy to manage in the UI HOT 5
- An error occurred in Firefox Profiler
- An error occurred in Firefox Profiler HOT 1
- Misleading URL in "Collapse resource" context menu item HOT 2
- An error occurred in Firefox Profiler
- An error occurred in Firefox Profiler HOT 2
- An error occurred in Firefox Profiler HOT 1
- new HOT 1
- 5
- Automatically open zip files with a single profile
- An error occurred in Firefox Profiler HOT 1
- Don't show "Lookup function name on Searchfox" in Single tab view
- Using Profiler without internet
- "RangeError: invalid digits value: NaN." when loading a profile HOT 2
- In the documentation, make the link to matrix more obvious
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from profiler.