Skip to content

Commit e93d384

Browse files
authored
perf - start to track aux sidebar (microsoft#254048)
1 parent a758f9e commit e93d384

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/vs/workbench/contrib/performance/browser/perfviewEditor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ class PerfModelContentProvider implements ITextModelContentProvider {
211211
table.push(['init keybindings, snippets & extensions from settings sync service', metrics.timers.ellapsedOtherUserDataInit, '[renderer]', undefined]);
212212
}
213213
table.push(['register extensions & spawn extension host', metrics.timers.ellapsedExtensions, '[renderer]', undefined]);
214-
table.push(['restore viewlet', metrics.timers.ellapsedViewletRestore, '[renderer]', metrics.viewletId]);
214+
table.push(['restore primary viewlet', metrics.timers.ellapsedViewletRestore, '[renderer]', metrics.viewletId]);
215+
table.push(['restore secondary viewlet', metrics.timers.ellapsedAuxiliaryViewletRestore, '[renderer]', metrics.auxiliaryViewletId]);
215216
table.push(['restore panel', metrics.timers.ellapsedPanelRestore, '[renderer]', metrics.panelId]);
216217
table.push(['restore & resolve visible editors', metrics.timers.ellapsedEditorRestore, '[renderer]', `${metrics.editorIds.length}: ${metrics.editorIds.join(', ')}`]);
217218
table.push(['create workbench contributions', metrics.timers.ellapsedWorkbenchContributions, '[renderer]', `${(contribTimings.get(LifecyclePhase.Starting)?.length ?? 0) + (contribTimings.get(LifecyclePhase.Starting)?.length ?? 0)} blocking startup`]);

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export interface IMemoryInfo {
6464
"timers.ellapsedExtensions" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
6565
"timers.ellapsedExtensionsReady" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
6666
"timers.ellapsedViewletRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
67+
"timers.ellapsedAuxiliaryViewletRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
6768
"timers.ellapsedPanelRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
6869
"timers.ellapsedEditorRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
6970
"timers.ellapsedWorkbenchContributions" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
@@ -123,6 +124,11 @@ export interface IStartupMetrics {
123124
*/
124125
readonly viewletId?: string;
125126

127+
/**
128+
* The active auxiliary viewlet id or `undedined`
129+
*/
130+
readonly auxiliaryViewletId?: string;
131+
126132
/**
127133
* The active panel id or `undefined`
128134
*/
@@ -338,7 +344,7 @@ export interface IStartupMetrics {
338344
readonly ellapsedExtensionsReady: number;
339345

340346
/**
341-
* The time it took to restore the viewlet.
347+
* The time it took to restore the primary sidebar viewlet.
342348
*
343349
* * Happens in the renderer-process
344350
* * Measured with the `willRestoreViewlet` and `didRestoreViewlet` performance marks.
@@ -347,6 +353,16 @@ export interface IStartupMetrics {
347353
*/
348354
readonly ellapsedViewletRestore: number;
349355

356+
/**
357+
* The time it took to restore the auxiliary bar viewlet.
358+
*
359+
* * Happens in the renderer-process
360+
* * Measured with the `willRestoreAuxiliaryBar` and `didRestoreAuxiliaryBar` performance marks.
361+
* * This should be looked at per viewlet-type/id.
362+
* * Happens in parallel to other things, depends on async timing
363+
*/
364+
readonly ellapsedAuxiliaryViewletRestore: number;
365+
350366
/**
351367
* The time it took to restore the panel.
352368
*
@@ -676,6 +692,7 @@ export abstract class AbstractTimerService implements ITimerService {
676692
}
677693

678694
const activeViewlet = this._paneCompositeService.getActivePaneComposite(ViewContainerLocation.Sidebar);
695+
const activeAuxiliaryViewlet = this._paneCompositeService.getActivePaneComposite(ViewContainerLocation.AuxiliaryBar);
679696
const activePanel = this._paneCompositeService.getActivePaneComposite(ViewContainerLocation.Panel);
680697
const info: Writeable<IStartupMetrics> = {
681698

@@ -687,6 +704,7 @@ export abstract class AbstractTimerService implements ITimerService {
687704
windowKind: this._lifecycleService.startupKind,
688705
windowCount: await this._getWindowCount(),
689706
viewletId: activeViewlet?.getId(),
707+
auxiliaryViewletId: activeAuxiliaryViewlet?.getId(),
690708
editorIds: this._editorService.visibleEditors.map(input => input.typeId),
691709
panelId: activePanel ? activePanel.getId() : undefined,
692710

@@ -714,6 +732,7 @@ export abstract class AbstractTimerService implements ITimerService {
714732
ellapsedExtensions: this._marks.getDuration('code/willLoadExtensions', 'code/didLoadExtensions'),
715733
ellapsedEditorRestore: this._marks.getDuration('code/willRestoreEditors', 'code/didRestoreEditors'),
716734
ellapsedViewletRestore: this._marks.getDuration('code/willRestoreViewlet', 'code/didRestoreViewlet'),
735+
ellapsedAuxiliaryViewletRestore: this._marks.getDuration('code/willRestoreAuxiliaryBar', 'code/didRestoreAuxiliaryBar'),
717736
ellapsedPanelRestore: this._marks.getDuration('code/willRestorePanel', 'code/didRestorePanel'),
718737
ellapsedWorkbenchContributions: this._marks.getDuration('code/willCreateWorkbenchContributions/1', 'code/didCreateWorkbenchContributions/2'),
719738
ellapsedWorkbench: this._marks.getDuration('code/willStartWorkbench', 'code/didStartWorkbench'),

0 commit comments

Comments
 (0)