Skip to content

Commit 44a246e

Browse files
author
Benjamin Pasero
committed
perf - measure workspace service init time as well
1 parent 6bcd5c4 commit 44a246e

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

src/vs/workbench/parts/performance/electron-browser/actions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class Info {
3939
table['require workspace storage'] = new Info(metrics.timers.ellapsedWorkspaceStorageRequire, '[renderer]');
4040
table['require & init workspace storage'] = new Info(metrics.timers.ellapsedWorkspaceStorageInit, '[renderer]');
4141

42+
table['init workspace service'] = new Info(metrics.timers.ellapsedWorkspaceServiceInit, '[renderer]');
43+
4244
table['register extensions & spawn extension host'] = new Info(metrics.timers.ellapsedExtensions, '[renderer]');
4345
table['restore viewlet'] = new Info(metrics.timers.ellapsedViewletRestore, '[renderer]', metrics.viewletId);
4446
table['restore panel'] = new Info(metrics.timers.ellapsedPanelRestore, '[renderer]', metrics.panelId);

src/vs/workbench/services/configuration/node/configurationService.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { UserConfiguration } from 'vs/platform/configuration/node/configuration'
3737
import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema';
3838
import { localize } from 'vs/nls';
3939
import { isEqual } from 'vs/base/common/resources';
40+
import { mark } from 'vs/base/common/performance';
4041

4142
export class WorkspaceService extends Disposable implements IWorkspaceConfigurationService, IWorkspaceContextService {
4243

@@ -292,8 +293,11 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
292293
}
293294

294295
initialize(arg: IWorkspaceInitializationPayload, postInitialisationTask: () => void = () => null): Promise<any> {
296+
mark('willInitWorkspaceService');
295297
return this.createWorkspace(arg)
296-
.then(workspace => this.updateWorkspaceAndInitializeConfiguration(workspace, postInitialisationTask));
298+
.then(workspace => this.updateWorkspaceAndInitializeConfiguration(workspace, postInitialisationTask)).then(() => {
299+
mark('didInitWorkspaceService');
300+
});
297301
}
298302

299303
acquireFileService(fileService: IFileService): void {

src/vs/workbench/services/timer/electron-browser/timerService.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ export interface IMemoryInfo {
5353
"timers.ellapsedExtensions" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
5454
"timers.ellapsedExtensionsReady" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
5555
"timers.ellapsedRequire" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
56-
"timers.ellapsedGlobalStorageInit" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
56+
"timers.ellapsedGlobalStorageInitMain" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
57+
"timers.ellapsedGlobalStorageInitRenderer" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
5758
"timers.ellapsedWorkspaceStorageRequire" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
5859
"timers.ellapsedWorkspaceStorageInit" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
60+
"timers.ellapsedWorkspaceServiceInit" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
5961
"timers.ellapsedViewletRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
6062
"timers.ellapsedPanelRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
6163
"timers.ellapsedEditorRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
@@ -229,6 +231,14 @@ export interface IStartupMetrics {
229231
*/
230232
ellapsedWorkspaceStorageInit: number;
231233

234+
/**
235+
* The time it took to initialize the workspace and configuration service.
236+
*
237+
* * Happens in the renderer-process
238+
* * Measured with the `willInitWorkspaceService` and `didInitWorkspaceService` performance marks.
239+
*/
240+
ellapsedWorkspaceServiceInit: number;
241+
232242
/**
233243
* The time it took to load the main-bundle of the workbench, e.g `workbench.main.js`.
234244
*
@@ -410,6 +420,7 @@ class TimerService implements ITimerService {
410420
ellapsedGlobalStorageInitRenderer: perf.getDuration('willInitGlobalStorage', 'didInitGlobalStorage'),
411421
ellapsedWorkspaceStorageRequire: perf.getDuration('willRequireSQLite', 'didRequireSQLite'),
412422
ellapsedWorkspaceStorageInit: perf.getDuration('willInitWorkspaceStorage', 'didInitWorkspaceStorage'),
423+
ellapsedWorkspaceServiceInit: perf.getDuration('willInitWorkspaceService', 'didInitWorkspaceService'),
413424
ellapsedExtensions: perf.getDuration('willLoadExtensions', 'didLoadExtensions'),
414425
ellapsedEditorRestore: perf.getDuration('willRestoreEditors', 'didRestoreEditors'),
415426
ellapsedViewletRestore: perf.getDuration('willRestoreViewlet', 'didRestoreViewlet'),

0 commit comments

Comments
 (0)