From 3969ef5b50e6b8ef4261012a5ee8c3d8b24662f5 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 1 Feb 2024 06:00:00 +0100 Subject: [PATCH] perf - track `ellapsedWorkbenchContributions` --- .../contrib/performance/browser/perfviewEditor.ts | 1 + .../workbench/services/timer/browser/timerService.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/vs/workbench/contrib/performance/browser/perfviewEditor.ts b/src/vs/workbench/contrib/performance/browser/perfviewEditor.ts index a06483bd1cf..846f995024c 100644 --- a/src/vs/workbench/contrib/performance/browser/perfviewEditor.ts +++ b/src/vs/workbench/contrib/performance/browser/perfviewEditor.ts @@ -215,6 +215,7 @@ class PerfModelContentProvider implements ITextModelContentProvider { table.push(['restore viewlet', metrics.timers.ellapsedViewletRestore, '[renderer]', metrics.viewletId]); table.push(['restore panel', metrics.timers.ellapsedPanelRestore, '[renderer]', metrics.panelId]); table.push(['restore & resolve visible editors', metrics.timers.ellapsedEditorRestore, '[renderer]', `${metrics.editorIds.length}: ${metrics.editorIds.join(', ')}`]); + table.push(['create workbench contributions', metrics.timers.ellapsedWorkbenchContributions, '[renderer]']); table.push(['overall workbench load', metrics.timers.ellapsedWorkbench, '[renderer]', undefined]); table.push(['workbench ready', metrics.ellapsed, '[main->renderer]', undefined]); table.push(['renderer ready', metrics.timers.ellapsedRenderer, '[renderer]', undefined]); diff --git a/src/vs/workbench/services/timer/browser/timerService.ts b/src/vs/workbench/services/timer/browser/timerService.ts index 28d247f2871..eb94174c972 100644 --- a/src/vs/workbench/services/timer/browser/timerService.ts +++ b/src/vs/workbench/services/timer/browser/timerService.ts @@ -66,6 +66,7 @@ export interface IMemoryInfo { "timers.ellapsedViewletRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "timers.ellapsedPanelRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "timers.ellapsedEditorRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, + "timers.ellapsedWorkbenchContributions" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "timers.ellapsedWorkbench" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "platform" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }, "release" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }, @@ -364,6 +365,16 @@ export interface IStartupMetrics { */ readonly ellapsedEditorRestore: number; + /** + * The time it took to create all workbench contributions on the starting and ready + * lifecycle phase, thus blocking `ellapsedWorkbench`. + * + * * Happens in the renderer-process + * * Measured with the `willCreateWorkbenchContributions/1` and `didCreateWorkbenchContributions/2` performance marks. + * + */ + readonly ellapsedWorkbenchContributions: number; + /** * The time it took to create the workbench. * @@ -686,6 +697,7 @@ export abstract class AbstractTimerService implements ITimerService { ellapsedEditorRestore: this._marks.getDuration('code/willRestoreEditors', 'code/didRestoreEditors'), ellapsedViewletRestore: this._marks.getDuration('code/willRestoreViewlet', 'code/didRestoreViewlet'), ellapsedPanelRestore: this._marks.getDuration('code/willRestorePanel', 'code/didRestorePanel'), + ellapsedWorkbenchContributions: this._marks.getDuration('code/willCreateWorkbenchContributions/1', 'code/didCreateWorkbenchContributions/2'), ellapsedWorkbench: this._marks.getDuration('code/willStartWorkbench', 'code/didStartWorkbench'), ellapsedExtensionsReady: this._marks.getDuration(startMark, 'code/didLoadExtensions'), ellapsedRenderer: this._marks.getDuration('code/didStartRenderer', 'code/didStartWorkbench')