Skip to content

Compare performance: Detect 'shadowed' cache hits and a few other fixes #4018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 30, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Store pipeline hash on PipelineSummary
  • Loading branch information
asgerf committed Apr 25, 2025
commit c72457785e43b26055dad077408fbc5b3602bc06
11 changes: 11 additions & 0 deletions extensions/ql-vscode/src/log-insights/performance-comparison.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { createHash } from "crypto";
import type { EvaluationLogScanner } from "./log-scanner";
import type { SummaryEvent } from "./log-summary";

export interface PipelineSummary {
steps: string[];
/** Total counts for each step in the RA array, across all iterations */
counts: number[];
hash: string;
}

/**
@@ -188,6 +190,7 @@ export class PerformanceOverviewScanner implements EvaluationLogScanner {
const pipelineSummary = (pipelineSummaries[raReference] ??= {
steps: event.ra[raReference],
counts: counts.map(() => 0),
hash: getPipelineHash(event.ra[raReference]),
});
const { counts: totalTuplesPerStep } = pipelineSummary;
for (let i = 0, length = counts.length; i < length; ++i) {
@@ -232,3 +235,11 @@ export class PerformanceOverviewScanner implements EvaluationLogScanner {

onDone(): void {}
}

function getPipelineHash(steps: string[]) {
const md5 = createHash("md5");
for (const step of steps) {
md5.write(step);
}
return md5.digest("base64");
}