Skip to content

Commit

Permalink
Validating device ID slows down window opening (fix #234064) (#234065)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero authored Nov 18, 2024
1 parent 0c9dd26 commit 4bfa2f8
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/vs/code/electron-main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,14 @@ export class CodeApplication extends Disposable {

// Set lifecycle phase to `Eventually` after a short delay and when idle (min 2.5sec, max 5sec)
const eventuallyPhaseScheduler = this._register(new RunOnceScheduler(() => {
this._register(runWhenGlobalIdle(() => this.lifecycleMainService.phase = LifecycleMainPhase.Eventually, 2500));
this._register(runWhenGlobalIdle(() => {

// Signal phase: eventually
this.lifecycleMainService.phase = LifecycleMainPhase.Eventually;

// Eventually Post Open Window Tasks
this.eventuallyAfterWindowOpen();
}, 2500));
}, 2500));
eventuallyPhaseScheduler.schedule();
}
Expand Down Expand Up @@ -1373,9 +1380,6 @@ export class CodeApplication extends Disposable {
if (isMacintosh && app.runningUnderARM64Translation) {
this.windowsMainService?.sendToFocused('vscode:showTranslatedBuildWarning');
}

// Validate Device ID is up to date
validatedevDeviceId(this.stateService, this.logService);
}

private async installMutex(): Promise<void> {
Expand Down Expand Up @@ -1451,4 +1455,11 @@ export class CodeApplication extends Disposable {
this.windowsMainService?.sendToFocused('vscode:showArgvParseWarning');
}
}

private eventuallyAfterWindowOpen(): void {

// Validate Device ID is up to date (delay this as it has shown significant perf impact)
// Refs: https://github.com/microsoft/vscode/issues/234064
validatedevDeviceId(this.stateService, this.logService);
}
}

0 comments on commit 4bfa2f8

Please sign in to comment.