Skip to content

Commit 6329d23

Browse files
committed
Store dependencies of predicates
1 parent 1165752 commit 6329d23

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

extensions/ql-vscode/src/log-insights/log-summary.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ interface SummaryEventBase {
2929

3030
interface ResultEventBase extends SummaryEventBase {
3131
resultSize: number;
32+
dependencies?: { [key: string]: string };
3233
}
3334

3435
export interface ComputeSimple extends ResultEventBase {
@@ -67,7 +68,6 @@ export interface NamedLocal extends ResultEventBase {
6768
ra: Ra;
6869
pipelineRuns: PipelineRun[];
6970
queryCausingWork?: string;
70-
dependencies: { [key: string]: string };
7171
predicateIterationMillis: number[];
7272
}
7373

extensions/ql-vscode/src/log-insights/performance-comparison.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ export interface PerformanceComparisonDataFromLog {
5656
* All the pipeline runs seen for the `i`th predicate from the `names` array.
5757
*/
5858
pipelineSummaryList: Array<Record<string, PipelineSummary>>;
59+
60+
/** All dependencies of the `i`th predicate from the `names` array, encoded as a list of indices in `names`. */
61+
dependencyLists: number[][];
5962
}
6063

6164
export class PerformanceOverviewScanner implements EvaluationLogScanner {
@@ -157,8 +160,10 @@ export class PerformanceOverviewScanner implements EvaluationLogScanner {
157160
iterationCounts,
158161
evaluationCounts,
159162
pipelineSummaryList,
163+
dependencyLists,
160164
} = this.data;
161165
const pipelineSummaries = pipelineSummaryList[index];
166+
const dependencyList = dependencyLists[index];
162167
for (const { counts, raReference } of event.pipelineRuns ?? []) {
163168
// Get or create the pipeline summary for this RA
164169
const pipelineSummary = (pipelineSummaries[raReference] ??= {
@@ -178,6 +183,12 @@ export class PerformanceOverviewScanner implements EvaluationLogScanner {
178183
totalTuplesPerStep[i] += count;
179184
}
180185
}
186+
for (const dependencyHash of Object.values(event.dependencies ?? {})) {
187+
const dependencyIndex = this.raToIndex.get(dependencyHash);
188+
if (dependencyIndex != null) {
189+
dependencyList.push(dependencyIndex);
190+
}
191+
}
181192
timeCosts[index] += totalTime;
182193
tupleCosts[index] += totalTuples;
183194
iterationCounts[index] += event.pipelineRuns?.length ?? 0;

0 commit comments

Comments
 (0)