@codingame/monaco-vscode-performance-service-override 5.3.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-performance-service-override",
3
- "version": "5.3.0",
3
+ "version": "6.0.1",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,6 +26,6 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@5.3.0"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@6.0.1"
30
30
  }
31
31
  }
@@ -1,3 +1,20 @@
1
+ var LoaderEventType;
2
+ ( (function(LoaderEventType) {
3
+ LoaderEventType[LoaderEventType["LoaderAvailable"] = 1] = "LoaderAvailable";
4
+ LoaderEventType[LoaderEventType["BeginLoadingScript"] = 10] = "BeginLoadingScript";
5
+ LoaderEventType[LoaderEventType["EndLoadingScriptOK"] = 11] = "EndLoadingScriptOK";
6
+ LoaderEventType[LoaderEventType["EndLoadingScriptError"] = 12] = "EndLoadingScriptError";
7
+ LoaderEventType[LoaderEventType["BeginInvokeFactory"] = 21] = "BeginInvokeFactory";
8
+ LoaderEventType[LoaderEventType["EndInvokeFactory"] = 22] = "EndInvokeFactory";
9
+ LoaderEventType[LoaderEventType["NodeBeginEvaluatingScript"] = 31] = "NodeBeginEvaluatingScript";
10
+ LoaderEventType[LoaderEventType["NodeEndEvaluatingScript"] = 32] = "NodeEndEvaluatingScript";
11
+ LoaderEventType[LoaderEventType["NodeBeginNativeRequire"] = 33] = "NodeBeginNativeRequire";
12
+ LoaderEventType[LoaderEventType["NodeEndNativeRequire"] = 34] = "NodeEndNativeRequire";
13
+ LoaderEventType[LoaderEventType["CachedDataFound"] = 60] = "CachedDataFound";
14
+ LoaderEventType[LoaderEventType["CachedDataMissed"] = 61] = "CachedDataMissed";
15
+ LoaderEventType[LoaderEventType["CachedDataRejected"] = 62] = "CachedDataRejected";
16
+ LoaderEventType[LoaderEventType["CachedDataCreated"] = 63] = "CachedDataCreated";
17
+ })(LoaderEventType || (LoaderEventType = {})));
1
18
  class LoaderStats {
2
19
  static get() {
3
20
  const amdLoadScript = ( new Map());
@@ -26,29 +43,29 @@ class LoaderStats {
26
43
  }
27
44
  for (const stat of stats) {
28
45
  switch (stat.type) {
29
- case 10 :
46
+ case LoaderEventType.BeginLoadingScript:
30
47
  mark(amdLoadScript, stat);
31
48
  break;
32
- case 11 :
33
- case 12 :
49
+ case LoaderEventType.EndLoadingScriptOK:
50
+ case LoaderEventType.EndLoadingScriptError:
34
51
  diff(amdLoadScript, stat);
35
52
  break;
36
- case 21 :
53
+ case LoaderEventType.BeginInvokeFactory:
37
54
  mark(amdInvokeFactory, stat);
38
55
  break;
39
- case 22 :
56
+ case LoaderEventType.EndInvokeFactory:
40
57
  diff(amdInvokeFactory, stat);
41
58
  break;
42
- case 33 :
59
+ case LoaderEventType.NodeBeginNativeRequire:
43
60
  mark(nodeRequire, stat);
44
61
  break;
45
- case 34 :
62
+ case LoaderEventType.NodeEndNativeRequire:
46
63
  diff(nodeRequire, stat);
47
64
  break;
48
- case 31 :
65
+ case LoaderEventType.NodeBeginEvaluatingScript:
49
66
  mark(nodeEval, stat);
50
67
  break;
51
- case 32 :
68
+ case LoaderEventType.NodeEndEvaluatingScript:
52
69
  diff(nodeEval, stat);
53
70
  break;
54
71
  }
@@ -99,4 +116,4 @@ class LoaderStats {
99
116
  }
100
117
  }
101
118
 
102
- export { LoaderStats };
119
+ export { LoaderEventType, LoaderStats };
@@ -1,6 +1,7 @@
1
1
  import { localize2WithPath } from 'vscode/vscode/vs/nls';
2
2
  import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
3
3
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
4
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
4
5
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
5
6
  import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
6
7
  import { registerWorkbenchContribution2, Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
@@ -99,4 +100,4 @@ registerAction2(class PrintEventProfiling extends Action2 {
99
100
  }
100
101
  }
101
102
  });
102
- ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(InputLatencyContrib, 4 );
103
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(InputLatencyContrib, LifecyclePhase.Eventually);
@@ -1,6 +1,7 @@
1
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
1
2
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
2
3
  import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
3
4
  import { BrowserResourcePerformanceMarks, BrowserStartupTimings } from './startupTimings.js';
4
5
 
5
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(BrowserResourcePerformanceMarks, 4 );
6
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(BrowserStartupTimings, 4 );
6
+ ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(BrowserResourcePerformanceMarks, LifecyclePhase.Eventually);
7
+ ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(BrowserStartupTimings, LifecyclePhase.Eventually);
@@ -3,7 +3,7 @@ import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
3
  import { URI } from 'vscode/vscode/vs/base/common/uri';
4
4
  import { TextResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/textResourceEditorInput';
5
5
  import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
6
- import { StartupKindToString } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
6
+ import { LifecyclePhase, StartupKindToString } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
7
7
  import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
8
8
  import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
9
9
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
@@ -13,7 +13,7 @@ import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extension
13
13
  import { dispose } from 'vscode/vscode/vs/base/common/lifecycle';
14
14
  import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
15
15
  import { writeTransientState } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/toggleWordWrap';
16
- import { LoaderStats } from '../../../../base/common/amd.js';
16
+ import { LoaderStats, LoaderEventType } from '../../../../base/common/amd.js';
17
17
  import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
18
18
  import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles.service';
19
19
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
@@ -104,7 +104,7 @@ let PerfModelContentProvider = class PerfModelContentProvider {
104
104
  _updateModel() {
105
105
  Promise.all([
106
106
  this._timerService.whenReady(),
107
- this._lifecycleService.when(4 ),
107
+ this._lifecycleService.when(LifecyclePhase.Eventually),
108
108
  this._extensionService.whenInstalledExtensionsRegistered(),
109
109
  this._terminalService.whenConnected
110
110
  ]).then(() => {
@@ -172,7 +172,7 @@ let PerfModelContentProvider = class PerfModelContentProvider {
172
172
  table.push(['restore viewlet', metrics.timers.ellapsedViewletRestore, '[renderer]', metrics.viewletId]);
173
173
  table.push(['restore panel', metrics.timers.ellapsedPanelRestore, '[renderer]', metrics.panelId]);
174
174
  table.push(['restore & resolve visible editors', metrics.timers.ellapsedEditorRestore, '[renderer]', `${metrics.editorIds.length}: ${metrics.editorIds.join(', ')}`]);
175
- table.push(['create workbench contributions', metrics.timers.ellapsedWorkbenchContributions, '[renderer]', `${(contribTimings.get(1 )?.length ?? 0) + (contribTimings.get(1 )?.length ?? 0)} blocking startup`]);
175
+ table.push(['create workbench contributions', metrics.timers.ellapsedWorkbenchContributions, '[renderer]', `${(contribTimings.get(LifecyclePhase.Starting)?.length ?? 0) + (contribTimings.get(LifecyclePhase.Starting)?.length ?? 0)} blocking startup`]);
176
176
  table.push(['overall workbench load', metrics.timers.ellapsedWorkbench, '[renderer]', undefined]);
177
177
  table.push(['workbench ready', metrics.ellapsed, '[main->renderer]', undefined]);
178
178
  table.push(['renderer ready', metrics.timers.ellapsedRenderer, '[renderer]', undefined]);
@@ -224,8 +224,8 @@ let PerfModelContentProvider = class PerfModelContentProvider {
224
224
  _addWorkbenchContributionsPerfMarksTable(md) {
225
225
  md.heading(2, 'Workbench Contributions Blocking Restore');
226
226
  const timings = ( (Registry.as(Extensions.Workbench))).timings;
227
- md.li(`Total (LifecyclePhase.Starting): ${timings.get(1 )?.length} (${timings.get(1 )?.reduce((p, c) => p + c[1], 0)}ms)`);
228
- md.li(`Total (LifecyclePhase.Ready): ${timings.get(2 )?.length} (${timings.get(2 )?.reduce((p, c) => p + c[1], 0)}ms)`);
227
+ md.li(`Total (LifecyclePhase.Starting): ${timings.get(LifecyclePhase.Starting)?.length} (${timings.get(LifecyclePhase.Starting)?.reduce((p, c) => p + c[1], 0)}ms)`);
228
+ md.li(`Total (LifecyclePhase.Ready): ${timings.get(LifecyclePhase.Ready)?.length} (${timings.get(LifecyclePhase.Ready)?.reduce((p, c) => p + c[1], 0)}ms)`);
229
229
  md.blank();
230
230
  const marks = this._timerService.getPerformanceMarks().find(e => e[0] === 'renderer')?.[1].filter(e => e.name.startsWith('code/willCreateWorkbenchContribution/1') ||
231
231
  e.name.startsWith('code/didCreateWorkbenchContribution/1') ||
@@ -265,10 +265,10 @@ let PerfModelContentProvider = class PerfModelContentProvider {
265
265
  }
266
266
  _addCachedDataStats(md) {
267
267
  const map = ( (new Map()));
268
- map.set(63 , []);
269
- map.set(60 , []);
270
- map.set(61 , []);
271
- map.set(62 , []);
268
+ map.set(LoaderEventType.CachedDataCreated, []);
269
+ map.set(LoaderEventType.CachedDataFound, []);
270
+ map.set(LoaderEventType.CachedDataMissed, []);
271
+ map.set(LoaderEventType.CachedDataRejected, []);
272
272
  if (typeof require.getStats === 'function') {
273
273
  for (const stat of require.getStats()) {
274
274
  if (( (map.has(stat.type)))) {
@@ -288,13 +288,13 @@ let PerfModelContentProvider = class PerfModelContentProvider {
288
288
  md.heading(2, 'Node Cached Data Stats');
289
289
  md.blank();
290
290
  md.heading(3, 'cached data used');
291
- printLists(map.get(60 ));
291
+ printLists(map.get(LoaderEventType.CachedDataFound));
292
292
  md.heading(3, 'cached data missed');
293
- printLists(map.get(61 ));
293
+ printLists(map.get(LoaderEventType.CachedDataMissed));
294
294
  md.heading(3, 'cached data rejected');
295
- printLists(map.get(62 ));
295
+ printLists(map.get(LoaderEventType.CachedDataRejected));
296
296
  md.heading(3, 'cached data created (lazy, might need refreshes)');
297
- printLists(map.get(63 ));
297
+ printLists(map.get(LoaderEventType.CachedDataCreated));
298
298
  }
299
299
  _addResourceTimingStats(md) {
300
300
  const stats = ( (performance.getEntriesByType('resource').map(entry => {
@@ -1,12 +1,13 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { isCodeEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
3
- import { StartupKindToString } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
3
+ import { StartupKind, StartupKindToString } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
4
4
  import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
5
5
  import { IUpdateService } from 'vscode/vscode/vs/platform/update/common/update.service';
6
6
  import { VIEWLET_ID } from 'vscode/vscode/vs/workbench/contrib/files/common/files';
7
7
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
8
8
  import { IWorkspaceTrustManagementService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust.service';
9
9
  import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
10
+ import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
10
11
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
11
12
  import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
12
13
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
@@ -24,13 +25,13 @@ let StartupTimings = class StartupTimings {
24
25
  this._workspaceTrustService = _workspaceTrustService;
25
26
  }
26
27
  async _isStandardStartup() {
27
- if (this._lifecycleService.startupKind !== 1 ) {
28
+ if (this._lifecycleService.startupKind !== StartupKind.NewWindow) {
28
29
  return StartupKindToString(this._lifecycleService.startupKind);
29
30
  }
30
31
  if (!this._workspaceTrustService.isWorkspaceTrusted()) {
31
32
  return 'Workspace not trusted';
32
33
  }
33
- const activeViewlet = this._paneCompositeService.getActivePaneComposite(0 );
34
+ const activeViewlet = this._paneCompositeService.getActivePaneComposite(ViewContainerLocation.Sidebar);
34
35
  if (!activeViewlet || activeViewlet.getId() !== VIEWLET_ID) {
35
36
  return 'Explorer viewlet not visible';
36
37
  }
@@ -41,9 +42,9 @@ let StartupTimings = class StartupTimings {
41
42
  if (!isCodeEditor(visibleEditorPanes[0].getControl())) {
42
43
  return 'Active editor is not a text editor';
43
44
  }
44
- const activePanel = this._paneCompositeService.getActivePaneComposite(1 );
45
+ const activePanel = this._paneCompositeService.getActivePaneComposite(ViewContainerLocation.Panel);
45
46
  if (activePanel) {
46
- return `Current active panel : ${this._paneCompositeService.getPaneComposite(activePanel.getId(), 1 )?.name}`;
47
+ return `Current active panel : ${this._paneCompositeService.getPaneComposite(activePanel.getId(), ViewContainerLocation.Panel)?.name}`;
47
48
  }
48
49
  const isLatestVersion = await this._updateService.isLatestVersion();
49
50
  if (isLatestVersion === false) {