Skip to content

Commit 4bfa2f8

Browse files
authored
Validating device ID slows down window opening (fix microsoft#234064) (microsoft#234065)
1 parent 0c9dd26 commit 4bfa2f8

File tree

1 file changed

+15
-4
lines changed
  • src/vs/code/electron-main

1 file changed

+15
-4
lines changed

src/vs/code/electron-main/app.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,14 @@ export class CodeApplication extends Disposable {
622622

623623
// Set lifecycle phase to `Eventually` after a short delay and when idle (min 2.5sec, max 5sec)
624624
const eventuallyPhaseScheduler = this._register(new RunOnceScheduler(() => {
625-
this._register(runWhenGlobalIdle(() => this.lifecycleMainService.phase = LifecycleMainPhase.Eventually, 2500));
625+
this._register(runWhenGlobalIdle(() => {
626+
627+
// Signal phase: eventually
628+
this.lifecycleMainService.phase = LifecycleMainPhase.Eventually;
629+
630+
// Eventually Post Open Window Tasks
631+
this.eventuallyAfterWindowOpen();
632+
}, 2500));
626633
}, 2500));
627634
eventuallyPhaseScheduler.schedule();
628635
}
@@ -1373,9 +1380,6 @@ export class CodeApplication extends Disposable {
13731380
if (isMacintosh && app.runningUnderARM64Translation) {
13741381
this.windowsMainService?.sendToFocused('vscode:showTranslatedBuildWarning');
13751382
}
1376-
1377-
// Validate Device ID is up to date
1378-
validatedevDeviceId(this.stateService, this.logService);
13791383
}
13801384

13811385
private async installMutex(): Promise<void> {
@@ -1451,4 +1455,11 @@ export class CodeApplication extends Disposable {
14511455
this.windowsMainService?.sendToFocused('vscode:showArgvParseWarning');
14521456
}
14531457
}
1458+
1459+
private eventuallyAfterWindowOpen(): void {
1460+
1461+
// Validate Device ID is up to date (delay this as it has shown significant perf impact)
1462+
// Refs: https://github.com/microsoft/vscode/issues/234064
1463+
validatedevDeviceId(this.stateService, this.logService);
1464+
}
14541465
}

0 commit comments

Comments
 (0)