1+ import { statSync } from "fs" ;
12import { ViewColumn } from "vscode" ;
23
34import type { App } from "../common/app" ;
@@ -11,6 +12,7 @@ import { showAndLogExceptionWithTelemetry } from "../common/logging";
1112import { extLogger } from "../common/logging/vscode" ;
1213import type { WebviewPanelConfig } from "../common/vscode/abstract-webview" ;
1314import { AbstractWebview } from "../common/vscode/abstract-webview" ;
15+ import { withProgress } from "../common/vscode/progress" ;
1416import { telemetryListener } from "../common/vscode/telemetry" ;
1517import type { HistoryItemLabelProvider } from "../query-history/history-item-label-provider" ;
1618import { PerformanceOverviewScanner } from "../log-insights/performance-comparison" ;
@@ -41,12 +43,22 @@ export class ComparePerformanceView extends AbstractWebview<
4143
4244 await this . waitForPanelLoaded ( ) ;
4345
44- // TODO: try processing in (async) parallel once readJsonl is streaming
45- const fromPerf = await scanLog (
46- fromJsonLog ,
47- new PerformanceOverviewScanner ( ) ,
48- ) ;
49- const toPerf = await scanLog ( toJsonLog , new PerformanceOverviewScanner ( ) ) ;
46+ function scanLogWithProgress ( log : string , logDescription : string ) {
47+ const bytes = statSync ( log ) . size ;
48+ return withProgress (
49+ async ( progress ) =>
50+ scanLog ( log , new PerformanceOverviewScanner ( ) , progress ) ,
51+
52+ {
53+ title : `Scanning evaluator log ${ logDescription } (${ ( bytes / 1024 / 1024 ) . toFixed ( 1 ) } MB)` ,
54+ } ,
55+ ) ;
56+ }
57+
58+ const [ fromPerf , toPerf ] = await Promise . all ( [
59+ scanLogWithProgress ( fromJsonLog , "1/2" ) ,
60+ scanLogWithProgress ( toJsonLog , "2/2" ) ,
61+ ] ) ;
5062
5163 await this . postMessage ( {
5264 t : "setPerformanceComparison" ,
0 commit comments