From cc94f1035cccb50983f2815278d043a0ac576e13 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Fri, 13 Oct 2023 11:10:05 -0400 Subject: [PATCH 1/3] Remove unused callNodeTable prop. --- src/components/sidebar/CallTreeSidebar.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/sidebar/CallTreeSidebar.js b/src/components/sidebar/CallTreeSidebar.js index 62be508c20..56fa52d85b 100644 --- a/src/components/sidebar/CallTreeSidebar.js +++ b/src/components/sidebar/CallTreeSidebar.js @@ -29,7 +29,6 @@ import type { ConnectedProps } from 'firefox-profiler/utils/connect'; import type { ThreadsKey, CategoryList, - CallNodeTable, IndexIntoCallNodeTable, TracedTiming, Milliseconds, @@ -286,7 +285,6 @@ export const CategoryBreakdown = explicitConnect< type StateProps = {| +selectedNodeIndex: IndexIntoCallNodeTable | null, - +callNodeTable: CallNodeTable, +selectedThreadsKey: ThreadsKey, +name: string, +lib: string, @@ -503,7 +501,6 @@ class CallTreeSidebarImpl extends React.PureComponent { export const CallTreeSidebar = explicitConnect<{||}, StateProps, {||}>({ mapStateToProps: (state) => ({ selectedNodeIndex: selectedThreadSelectors.getSelectedCallNodeIndex(state), - callNodeTable: selectedThreadSelectors.getCallNodeInfo(state).callNodeTable, selectedThreadsKey: getSelectedThreadsKey(state), name: getFunctionName(selectedNodeSelectors.getName(state)), lib: selectedNodeSelectors.getLib(state), From 502cab11528ae1a99dd23473368f3220a0fe0234 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Fri, 13 Oct 2023 11:12:50 -0400 Subject: [PATCH 2/3] Remove unused maxDepth computation from ThreadSampleGraph. --- src/components/shared/thread/SampleGraph.js | 10 ---------- src/components/timeline/TrackThread.js | 1 - 2 files changed, 11 deletions(-) diff --git a/src/components/shared/thread/SampleGraph.js b/src/components/shared/thread/SampleGraph.js index c0da06a9e7..e4d658d965 100644 --- a/src/components/shared/thread/SampleGraph.js +++ b/src/components/shared/thread/SampleGraph.js @@ -20,7 +20,6 @@ import type { CategoryList, IndexIntoSamplesTable, Milliseconds, - CallNodeInfo, IndexIntoCallNodeTable, SelectedState, } from 'firefox-profiler/types'; @@ -34,7 +33,6 @@ type Props = {| +interval: Milliseconds, +rangeStart: Milliseconds, +rangeEnd: Milliseconds, - +callNodeInfo: CallNodeInfo, +categories: CategoryList, +onSampleClick: ( event: SyntheticMouseEvent<>, @@ -96,7 +94,6 @@ export class ThreadSampleGraphImpl extends PureComponent { interval, rangeStart, rangeEnd, - callNodeInfo, samplesSelectedStates, sampleCallNodes, categories, @@ -110,13 +107,6 @@ export class ThreadSampleGraphImpl extends PureComponent { canvas.width = Math.round(width * devicePixelRatio); canvas.height = Math.round(height * devicePixelRatio); const ctx = canvas.getContext('2d'); - let maxDepth = 0; - const { callNodeTable } = callNodeInfo; - for (let i = 0; i < callNodeTable.depth.length; i++) { - if (callNodeTable.depth[i] > maxDepth) { - maxDepth = callNodeTable.depth[i]; - } - } const range = [rangeStart, rangeEnd]; const rangeLength = range[1] - range[0]; const xPixelsPerMs = canvas.width / rangeLength; diff --git a/src/components/timeline/TrackThread.js b/src/components/timeline/TrackThread.js index 8ec74d88b0..f8113c075c 100644 --- a/src/components/timeline/TrackThread.js +++ b/src/components/timeline/TrackThread.js @@ -285,7 +285,6 @@ class TimelineTrackThreadImpl extends PureComponent { thread={filteredThread} rangeStart={rangeStart} rangeEnd={rangeEnd} - callNodeInfo={callNodeInfo} sampleCallNodes={sampleCallNodes} samplesSelectedStates={samplesSelectedStates} categories={categories} From 8d4a1f4d70ce1d83ce7626ea938e2ffd5edf102a Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Fri, 13 Oct 2023 11:13:45 -0400 Subject: [PATCH 3/3] Remove unused thread argument. --- src/profile-logic/transforms.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/profile-logic/transforms.js b/src/profile-logic/transforms.js index 2643fe720a..3934daba2f 100644 --- a/src/profile-logic/transforms.js +++ b/src/profile-logic/transforms.js @@ -507,7 +507,6 @@ export function applyTransformToCallNodePath( return _startCallNodePathWithFunction(transform.funcIndex, callNodePath); case 'focus-category': return _removeOtherCategoryFunctionsInNodePathWithFunction( - transformedThread, transform.category, callNodePath, callNodeTable @@ -597,7 +596,6 @@ function _dropFunctionInCallNodePath( // removes all functions that are not in the category from the callNodePath function _removeOtherCategoryFunctionsInNodePathWithFunction( - thread: Thread, category: IndexIntoCategoryList, callNodePath: CallNodePath, callNodeTable: CallNodeTable