1+ import { statSync } from "fs" ;
12import path from "path" ;
23import { ViewColumn } from "vscode" ;
34import type { CodeQLCliServer } from "../codeql-cli/cli" ;
@@ -12,6 +13,7 @@ import { showAndLogExceptionWithTelemetry } from "../common/logging";
1213import { extLogger } from "../common/logging/vscode" ;
1314import type { WebviewPanelConfig } from "../common/vscode/abstract-webview" ;
1415import { AbstractWebview } from "../common/vscode/abstract-webview" ;
16+ import { withProgress } from "../common/vscode/progress" ;
1517import { telemetryListener } from "../common/vscode/telemetry" ;
1618import type { ResultsView } from "../local-queries" ;
1719import { scanLog } from "../log-insights/log-scanner" ;
@@ -54,12 +56,22 @@ export class ComparePerformanceView extends AbstractWebview<
5456
5557 await this . waitForPanelLoaded ( ) ;
5658
57- // TODO: try processing in (async) parallel once readJsonl is streaming
58- const fromPerf = await scanLog (
59- fromJsonLog ,
60- new PerformanceOverviewScanner ( ) ,
61- ) ;
62- const toPerf = await scanLog ( toJsonLog , new PerformanceOverviewScanner ( ) ) ;
59+ function scanLogWithProgress ( log : string , logDescription : string ) {
60+ const bytes = statSync ( log ) . size ;
61+ return withProgress (
62+ async ( progress ) =>
63+ scanLog ( log , new PerformanceOverviewScanner ( ) , progress ) ,
64+
65+ {
66+ title : `Scanning evaluator log ${ logDescription } (${ ( bytes / 1024 / 1024 ) . toFixed ( 1 ) } MB)` ,
67+ } ,
68+ ) ;
69+ }
70+
71+ const [ fromPerf , toPerf ] = await Promise . all ( [
72+ scanLogWithProgress ( fromJsonLog , "1/2" ) ,
73+ scanLogWithProgress ( toJsonLog , "2/2" ) ,
74+ ] ) ;
6375
6476 // TODO: filter out irrelevant common predicates before transfer?
6577
0 commit comments