@codingame/monaco-vscode-performance-service-override 8.0.4 → 9.0.2

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": "8.0.4",
3
+ "version": "9.0.2",
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@8.0.4"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@9.0.2"
30
30
  }
31
31
  }
@@ -28,7 +28,7 @@ registerAction2(class extends Action2 {
28
28
  constructor() {
29
29
  super({
30
30
  id: 'perfview.show',
31
- title: ( localize2(2680, 'Startup Performance')),
31
+ title: ( localize2(2692, 'Startup Performance')),
32
32
  category: Categories.Developer,
33
33
  f1: true
34
34
  });
@@ -43,7 +43,7 @@ registerAction2(class PrintServiceCycles extends Action2 {
43
43
  constructor() {
44
44
  super({
45
45
  id: 'perf.insta.printAsyncCycles',
46
- title: ( localize2(2681, 'Print Service Cycles')),
46
+ title: ( localize2(2693, 'Print Service Cycles')),
47
47
  category: Categories.Developer,
48
48
  f1: true
49
49
  });
@@ -65,7 +65,7 @@ registerAction2(class PrintServiceTraces extends Action2 {
65
65
  constructor() {
66
66
  super({
67
67
  id: 'perf.insta.printTraces',
68
- title: ( localize2(2682, 'Print Service Traces')),
68
+ title: ( localize2(2694, 'Print Service Traces')),
69
69
  category: Categories.Developer,
70
70
  f1: true
71
71
  });
@@ -84,7 +84,7 @@ registerAction2(class PrintEventProfiling extends Action2 {
84
84
  constructor() {
85
85
  super({
86
86
  id: 'perf.event.profiling',
87
- title: ( localize2(2683, 'Print Emitter Profiles')),
87
+ title: ( localize2(2695, 'Print Emitter Profiles')),
88
88
  category: Categories.Developer,
89
89
  f1: true
90
90
  });
@@ -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, LoaderEventType } from '../../../../base/common/amd.js';
16
+ import { LoaderStats, LoaderEventType } from 'vscode/vscode/vs/base/common/amd';
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';
@@ -61,7 +61,7 @@ let PerfviewInput = class PerfviewInput extends TextResourceEditorInput {
61
61
  return PerfviewInput_1.Id;
62
62
  }
63
63
  constructor(textModelResolverService, textFileService, editorService, fileService, labelService, filesConfigurationService, textResourceConfigurationService, customEditorLabelService) {
64
- super(PerfviewContrib.get().getInputUri(), ( localize(6146, "Startup Performance")), undefined, undefined, undefined, textModelResolverService, textFileService, editorService, fileService, labelService, filesConfigurationService, textResourceConfigurationService, customEditorLabelService);
64
+ super(PerfviewContrib.get().getInputUri(), ( localize(6118, "Startup Performance")), undefined, undefined, undefined, textModelResolverService, textFileService, editorService, fileService, labelService, filesConfigurationService, textResourceConfigurationService, customEditorLabelService);
65
65
  }
66
66
  };
67
67
  PerfviewInput = PerfviewInput_1 = ( (__decorate([
@@ -153,13 +153,13 @@ let PerfModelContentProvider = class PerfModelContentProvider {
153
153
  const table = [];
154
154
  table.push(['start => app.isReady', metrics.timers.ellapsedAppReady, '[main]', `initial startup: ${metrics.initialStartup}`]);
155
155
  table.push(['nls:start => nls:end', metrics.timers.ellapsedNlsGeneration, '[main]', `initial startup: ${metrics.initialStartup}`]);
156
- table.push(['require(main.bundle.js)', metrics.timers.ellapsedLoadMainBundle, '[main]', `initial startup: ${metrics.initialStartup}`]);
156
+ table.push(['import(main.bundle.js)', metrics.timers.ellapsedLoadMainBundle, '[main]', `initial startup: ${metrics.initialStartup}`]);
157
157
  table.push(['start crash reporter', metrics.timers.ellapsedCrashReporter, '[main]', `initial startup: ${metrics.initialStartup}`]);
158
158
  table.push(['serve main IPC handle', metrics.timers.ellapsedMainServer, '[main]', `initial startup: ${metrics.initialStartup}`]);
159
159
  table.push(['create window', metrics.timers.ellapsedWindowCreate, '[main]', `initial startup: ${metrics.initialStartup}, ${metrics.initialStartup ? `state: ${metrics.timers.ellapsedWindowRestoreState}ms, widget: ${metrics.timers.ellapsedBrowserWindowCreate}ms, show: ${metrics.timers.ellapsedWindowMaximize}ms` : ''}`]);
160
160
  table.push(['app.isReady => window.loadUrl()', metrics.timers.ellapsedWindowLoad, '[main]', `initial startup: ${metrics.initialStartup}`]);
161
- table.push(['window.loadUrl() => begin to require(workbench.desktop.main.js)', metrics.timers.ellapsedWindowLoadToRequire, '[main->renderer]', StartupKindToString(metrics.windowKind)]);
162
- table.push(['require(workbench.desktop.main.js)', metrics.timers.ellapsedRequire, '[renderer]', `cached data: ${(metrics.didUseCachedData ? 'YES' : 'NO')}${stats ? `, node_modules took ${stats.nodeRequireTotal}ms` : ''}`]);
161
+ table.push(['window.loadUrl() => begin to import(workbench.desktop.main.js)', metrics.timers.ellapsedWindowLoadToRequire, '[main->renderer]', StartupKindToString(metrics.windowKind)]);
162
+ table.push(['import(workbench.desktop.main.js)', metrics.timers.ellapsedRequire, '[renderer]', `cached data: ${(metrics.didUseCachedData ? 'YES' : 'NO')}${stats ? `, node_modules took ${stats.nodeRequireTotal}ms` : ''}`]);
163
163
  table.push(['wait for window config', metrics.timers.ellapsedWaitForWindowConfig, '[renderer]', undefined]);
164
164
  table.push(['init storage (global & workspace)', metrics.timers.ellapsedStorageInit, '[renderer]', undefined]);
165
165
  table.push(['init workspace service', metrics.timers.ellapsedWorkspaceServiceInit, '[renderer]', undefined]);
@@ -268,13 +268,6 @@ let PerfModelContentProvider = class PerfModelContentProvider {
268
268
  map.set(LoaderEventType.CachedDataFound, []);
269
269
  map.set(LoaderEventType.CachedDataMissed, []);
270
270
  map.set(LoaderEventType.CachedDataRejected, []);
271
- if (typeof require.getStats === 'function') {
272
- for (const stat of require.getStats()) {
273
- if (( (map.has(stat.type)))) {
274
- map.get(stat.type).push(stat.detail);
275
- }
276
- }
277
- }
278
271
  const printLists = (arr) => {
279
272
  if (arr) {
280
273
  arr.sort();
@@ -1,119 +0,0 @@
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 = {})));
18
- class LoaderStats {
19
- static get() {
20
- const amdLoadScript = ( new Map());
21
- const amdInvokeFactory = ( new Map());
22
- const nodeRequire = ( new Map());
23
- const nodeEval = ( new Map());
24
- function mark(map, stat) {
25
- if (( map.has(stat.detail))) {
26
- return;
27
- }
28
- map.set(stat.detail, -stat.timestamp);
29
- }
30
- function diff(map, stat) {
31
- const duration = map.get(stat.detail);
32
- if (!duration) {
33
- return;
34
- }
35
- if (duration >= 0) {
36
- return;
37
- }
38
- map.set(stat.detail, duration + stat.timestamp);
39
- }
40
- let stats = [];
41
- if (typeof require === 'function' && typeof require.getStats === 'function') {
42
- stats = require.getStats().slice(0).sort((a, b) => a.timestamp - b.timestamp);
43
- }
44
- for (const stat of stats) {
45
- switch (stat.type) {
46
- case LoaderEventType.BeginLoadingScript:
47
- mark(amdLoadScript, stat);
48
- break;
49
- case LoaderEventType.EndLoadingScriptOK:
50
- case LoaderEventType.EndLoadingScriptError:
51
- diff(amdLoadScript, stat);
52
- break;
53
- case LoaderEventType.BeginInvokeFactory:
54
- mark(amdInvokeFactory, stat);
55
- break;
56
- case LoaderEventType.EndInvokeFactory:
57
- diff(amdInvokeFactory, stat);
58
- break;
59
- case LoaderEventType.NodeBeginNativeRequire:
60
- mark(nodeRequire, stat);
61
- break;
62
- case LoaderEventType.NodeEndNativeRequire:
63
- diff(nodeRequire, stat);
64
- break;
65
- case LoaderEventType.NodeBeginEvaluatingScript:
66
- mark(nodeEval, stat);
67
- break;
68
- case LoaderEventType.NodeEndEvaluatingScript:
69
- diff(nodeEval, stat);
70
- break;
71
- }
72
- }
73
- let nodeRequireTotal = 0;
74
- nodeRequire.forEach(value => nodeRequireTotal += value);
75
- function to2dArray(map) {
76
- const res = [];
77
- map.forEach((value, index) => res.push([index, value]));
78
- return res;
79
- }
80
- return {
81
- amdLoad: to2dArray(amdLoadScript),
82
- amdInvoke: to2dArray(amdInvokeFactory),
83
- nodeRequire: to2dArray(nodeRequire),
84
- nodeEval: to2dArray(nodeEval),
85
- nodeRequireTotal
86
- };
87
- }
88
- static toMarkdownTable(header, rows) {
89
- let result = '';
90
- const lengths = [];
91
- header.forEach((cell, ci) => {
92
- lengths[ci] = cell.length;
93
- });
94
- rows.forEach(row => {
95
- row.forEach((cell, ci) => {
96
- if (typeof cell === 'undefined') {
97
- cell = row[ci] = '-';
98
- }
99
- const len = ( cell.toString()).length;
100
- lengths[ci] = Math.max(len, lengths[ci]);
101
- });
102
- });
103
- header.forEach((cell, ci) => { result += `| ${cell + ' '.repeat(lengths[ci] - ( cell.toString()).length)} `; });
104
- result += '|\n';
105
- header.forEach((_cell, ci) => { result += `| ${'-'.repeat(lengths[ci])} `; });
106
- result += '|\n';
107
- rows.forEach(row => {
108
- row.forEach((cell, ci) => {
109
- if (typeof cell !== 'undefined') {
110
- result += `| ${cell + ' '.repeat(lengths[ci] - ( cell.toString()).length)} `;
111
- }
112
- });
113
- result += '|\n';
114
- });
115
- return result;
116
- }
117
- }
118
-
119
- export { LoaderEventType, LoaderStats };