@codingame/monaco-vscode-performance-service-override 25.1.2 → 26.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 +2 -2
- package/vscode/src/vs/workbench/contrib/performance/browser/inputLatencyContrib.js +4 -8
- package/vscode/src/vs/workbench/contrib/performance/browser/performance.contribution.js +25 -20
- package/vscode/src/vs/workbench/contrib/performance/browser/perfviewEditor.js +292 -108
- package/vscode/src/vs/workbench/contrib/performance/browser/startupTimings.js +37 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-performance-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "26.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - performance service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "26.0.1"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -19,7 +19,7 @@ let InputLatencyContrib = class InputLatencyContrib extends Disposable {
|
|
|
19
19
|
this._logSamples();
|
|
20
20
|
this._setupListener();
|
|
21
21
|
}, 60000)));
|
|
22
|
-
if (Math.random() <= 0.01 || this._configurationService.getValue(
|
|
22
|
+
if (Math.random() <= 0.01 || this._configurationService.getValue("editor.experimentalGpuAcceleration") === "on") {
|
|
23
23
|
this._setupListener();
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -31,20 +31,16 @@ let InputLatencyContrib = class InputLatencyContrib extends Disposable {
|
|
|
31
31
|
if (!measurements) {
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
this._telemetryService.publicLog2(
|
|
34
|
+
this._telemetryService.publicLog2("performance.inputLatency", {
|
|
35
35
|
keydown: measurements.keydown,
|
|
36
36
|
input: measurements.input,
|
|
37
37
|
render: measurements.render,
|
|
38
38
|
total: measurements.total,
|
|
39
39
|
sampleCount: measurements.sampleCount,
|
|
40
|
-
gpuAcceleration: this._configurationService.getValue(
|
|
40
|
+
gpuAcceleration: this._configurationService.getValue("editor.experimentalGpuAcceleration") === "on"
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
InputLatencyContrib = ( __decorate([
|
|
45
|
-
( __param(0, IConfigurationService)),
|
|
46
|
-
( __param(1, IEditorService)),
|
|
47
|
-
( __param(2, ITelemetryService))
|
|
48
|
-
], InputLatencyContrib));
|
|
44
|
+
InputLatencyContrib = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IEditorService)), ( __param(2, ITelemetryService))], InputLatencyContrib));
|
|
49
45
|
|
|
50
46
|
export { InputLatencyContrib };
|
|
@@ -16,13 +16,15 @@ import { InputLatencyContrib } from './inputLatencyContrib.js';
|
|
|
16
16
|
import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service';
|
|
17
17
|
import { setDisposableTracker, GCBasedDisposableTracker } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
18
18
|
|
|
19
|
-
registerWorkbenchContribution2(PerfviewContrib.ID, PerfviewContrib, {
|
|
19
|
+
registerWorkbenchContribution2(PerfviewContrib.ID, PerfviewContrib, {
|
|
20
|
+
lazy: true
|
|
21
|
+
});
|
|
20
22
|
( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(PerfviewInput.Id, class {
|
|
21
23
|
canSerialize() {
|
|
22
24
|
return true;
|
|
23
25
|
}
|
|
24
26
|
serialize() {
|
|
25
|
-
return
|
|
27
|
+
return "";
|
|
26
28
|
}
|
|
27
29
|
deserialize(instantiationService) {
|
|
28
30
|
return instantiationService.createInstance(PerfviewInput);
|
|
@@ -31,8 +33,8 @@ registerWorkbenchContribution2(PerfviewContrib.ID, PerfviewContrib, { lazy: true
|
|
|
31
33
|
registerAction2(class extends Action2 {
|
|
32
34
|
constructor() {
|
|
33
35
|
super({
|
|
34
|
-
id:
|
|
35
|
-
title: ( localize2(
|
|
36
|
+
id: "perfview.show",
|
|
37
|
+
title: ( localize2(10149, "Startup Performance")),
|
|
36
38
|
category: Categories.Developer,
|
|
37
39
|
f1: true
|
|
38
40
|
});
|
|
@@ -40,14 +42,16 @@ registerAction2(class extends Action2 {
|
|
|
40
42
|
run(accessor) {
|
|
41
43
|
const editorService = accessor.get(IEditorService);
|
|
42
44
|
const contrib = PerfviewContrib.get();
|
|
43
|
-
return editorService.openEditor(contrib.getEditorInput(), {
|
|
45
|
+
return editorService.openEditor(contrib.getEditorInput(), {
|
|
46
|
+
pinned: true
|
|
47
|
+
});
|
|
44
48
|
}
|
|
45
49
|
});
|
|
46
50
|
registerAction2(class PrintServiceCycles extends Action2 {
|
|
47
51
|
constructor() {
|
|
48
52
|
super({
|
|
49
|
-
id:
|
|
50
|
-
title: ( localize2(
|
|
53
|
+
id: "perf.insta.printAsyncCycles",
|
|
54
|
+
title: ( localize2(10150, "Print Service Cycles")),
|
|
51
55
|
category: Categories.Developer,
|
|
52
56
|
f1: true
|
|
53
57
|
});
|
|
@@ -58,8 +62,7 @@ registerAction2(class PrintServiceCycles extends Action2 {
|
|
|
58
62
|
const cycle = instaService._globalGraph?.findCycleSlow();
|
|
59
63
|
if (cycle) {
|
|
60
64
|
console.warn(`CYCLE`, cycle);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
65
|
+
} else {
|
|
63
66
|
console.warn(`YEAH, no more cycles`);
|
|
64
67
|
}
|
|
65
68
|
}
|
|
@@ -68,15 +71,15 @@ registerAction2(class PrintServiceCycles extends Action2 {
|
|
|
68
71
|
registerAction2(class PrintServiceTraces extends Action2 {
|
|
69
72
|
constructor() {
|
|
70
73
|
super({
|
|
71
|
-
id:
|
|
72
|
-
title: ( localize2(
|
|
74
|
+
id: "perf.insta.printTraces",
|
|
75
|
+
title: ( localize2(10151, "Print Service Traces")),
|
|
73
76
|
category: Categories.Developer,
|
|
74
77
|
f1: true
|
|
75
78
|
});
|
|
76
79
|
}
|
|
77
80
|
run() {
|
|
78
81
|
if (Trace.all.size === 0) {
|
|
79
|
-
console.log(
|
|
82
|
+
console.log("Enable via `instantiationService.ts#_enableAllTracing`");
|
|
80
83
|
return;
|
|
81
84
|
}
|
|
82
85
|
for (const item of Trace.all) {
|
|
@@ -87,32 +90,34 @@ registerAction2(class PrintServiceTraces extends Action2 {
|
|
|
87
90
|
registerAction2(class PrintEventProfiling extends Action2 {
|
|
88
91
|
constructor() {
|
|
89
92
|
super({
|
|
90
|
-
id:
|
|
91
|
-
title: ( localize2(
|
|
93
|
+
id: "perf.event.profiling",
|
|
94
|
+
title: ( localize2(10152, "Print Emitter Profiles")),
|
|
92
95
|
category: Categories.Developer,
|
|
93
96
|
f1: true
|
|
94
97
|
});
|
|
95
98
|
}
|
|
96
99
|
run() {
|
|
97
100
|
if (EventProfiling.all.size === 0) {
|
|
98
|
-
console.log(
|
|
101
|
+
console.log("USE `EmitterOptions._profName` to enable profiling");
|
|
99
102
|
return;
|
|
100
103
|
}
|
|
101
104
|
for (const item of EventProfiling.all) {
|
|
102
|
-
console.log(
|
|
105
|
+
console.log(
|
|
106
|
+
`${item.name}: ${item.invocationCount} invocations COST ${item.elapsedOverall}ms, ${item.listenerCount} listeners, avg cost is ${item.durations.reduce((a, b) => a + b, 0) / item.durations.length}ms`
|
|
107
|
+
);
|
|
103
108
|
}
|
|
104
109
|
}
|
|
105
110
|
});
|
|
106
111
|
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(InputLatencyContrib, LifecyclePhase.Eventually);
|
|
107
112
|
let DisposableTracking = class DisposableTracking {
|
|
108
|
-
static {
|
|
113
|
+
static {
|
|
114
|
+
this.Id = "perf.disposableTracking";
|
|
115
|
+
}
|
|
109
116
|
constructor(envService) {
|
|
110
117
|
if (!envService.isBuilt && !envService.extensionTestsLocationURI) {
|
|
111
118
|
setDisposableTracker(( new GCBasedDisposableTracker()));
|
|
112
119
|
}
|
|
113
120
|
}
|
|
114
121
|
};
|
|
115
|
-
DisposableTracking = ( __decorate([
|
|
116
|
-
( __param(0, IEnvironmentService))
|
|
117
|
-
], DisposableTracking));
|
|
122
|
+
DisposableTracking = ( __decorate([( __param(0, IEnvironmentService))], DisposableTracking));
|
|
118
123
|
registerWorkbenchContribution2(DisposableTracking.Id, DisposableTracking, WorkbenchPhase.Eventually);
|
|
@@ -32,15 +32,22 @@ import { mainWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/
|
|
|
32
32
|
|
|
33
33
|
var PerfviewContrib_1, PerfviewInput_1;
|
|
34
34
|
let PerfviewContrib = class PerfviewContrib {
|
|
35
|
-
static {
|
|
35
|
+
static {
|
|
36
|
+
PerfviewContrib_1 = this;
|
|
37
|
+
}
|
|
36
38
|
static get() {
|
|
37
39
|
return getWorkbenchContribution(PerfviewContrib_1.ID);
|
|
38
40
|
}
|
|
39
|
-
static {
|
|
41
|
+
static {
|
|
42
|
+
this.ID = "workbench.contrib.perfview";
|
|
43
|
+
}
|
|
40
44
|
constructor(_instaService, textModelResolverService) {
|
|
41
45
|
this._instaService = _instaService;
|
|
42
|
-
this._inputUri = ( URI.from({
|
|
43
|
-
|
|
46
|
+
this._inputUri = ( URI.from({
|
|
47
|
+
scheme: "perf",
|
|
48
|
+
path: "Startup Performance"
|
|
49
|
+
}));
|
|
50
|
+
this._registration = textModelResolverService.registerTextModelContentProvider("perf", _instaService.createInstance(PerfModelContentProvider));
|
|
44
51
|
}
|
|
45
52
|
dispose() {
|
|
46
53
|
this._registration.dispose();
|
|
@@ -52,32 +59,43 @@ let PerfviewContrib = class PerfviewContrib {
|
|
|
52
59
|
return this._instaService.createInstance(PerfviewInput);
|
|
53
60
|
}
|
|
54
61
|
};
|
|
55
|
-
PerfviewContrib = PerfviewContrib_1 = ( __decorate([
|
|
56
|
-
( __param(0, IInstantiationService)),
|
|
57
|
-
( __param(1, ITextModelService))
|
|
58
|
-
], PerfviewContrib));
|
|
62
|
+
PerfviewContrib = PerfviewContrib_1 = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, ITextModelService))], PerfviewContrib));
|
|
59
63
|
let PerfviewInput = class PerfviewInput extends TextResourceEditorInput {
|
|
60
|
-
static {
|
|
61
|
-
|
|
64
|
+
static {
|
|
65
|
+
PerfviewInput_1 = this;
|
|
66
|
+
}
|
|
67
|
+
static {
|
|
68
|
+
this.Id = "PerfviewInput";
|
|
69
|
+
}
|
|
62
70
|
get typeId() {
|
|
63
71
|
return PerfviewInput_1.Id;
|
|
64
72
|
}
|
|
65
|
-
constructor(
|
|
66
|
-
|
|
73
|
+
constructor(
|
|
74
|
+
textModelResolverService,
|
|
75
|
+
textFileService,
|
|
76
|
+
editorService,
|
|
77
|
+
fileService,
|
|
78
|
+
labelService,
|
|
79
|
+
filesConfigurationService,
|
|
80
|
+
textResourceConfigurationService,
|
|
81
|
+
customEditorLabelService
|
|
82
|
+
) {
|
|
83
|
+
super(PerfviewContrib.get().getInputUri(), ( localize(10153, "Startup Performance")), undefined, undefined, undefined, textModelResolverService, textFileService, editorService, fileService, labelService, filesConfigurationService, textResourceConfigurationService, customEditorLabelService);
|
|
67
84
|
}
|
|
68
85
|
};
|
|
69
|
-
PerfviewInput = PerfviewInput_1 = ( __decorate([
|
|
70
|
-
( __param(0, ITextModelService)),
|
|
71
|
-
( __param(1, ITextFileService)),
|
|
72
|
-
( __param(2, IEditorService)),
|
|
73
|
-
( __param(3, IFileService)),
|
|
74
|
-
( __param(4, ILabelService)),
|
|
75
|
-
( __param(5, IFilesConfigurationService)),
|
|
76
|
-
( __param(6, ITextResourceConfigurationService)),
|
|
77
|
-
( __param(7, ICustomEditorLabelService))
|
|
78
|
-
], PerfviewInput));
|
|
86
|
+
PerfviewInput = PerfviewInput_1 = ( __decorate([( __param(0, ITextModelService)), ( __param(1, ITextFileService)), ( __param(2, IEditorService)), ( __param(3, IFileService)), ( __param(4, ILabelService)), ( __param(5, IFilesConfigurationService)), ( __param(6, ITextResourceConfigurationService)), ( __param(7, ICustomEditorLabelService))], PerfviewInput));
|
|
79
87
|
let PerfModelContentProvider = class PerfModelContentProvider {
|
|
80
|
-
constructor(
|
|
88
|
+
constructor(
|
|
89
|
+
_modelService,
|
|
90
|
+
_languageService,
|
|
91
|
+
_editorService,
|
|
92
|
+
_lifecycleService,
|
|
93
|
+
_timerService,
|
|
94
|
+
_extensionService,
|
|
95
|
+
_productService,
|
|
96
|
+
_remoteAgentService,
|
|
97
|
+
_terminalService
|
|
98
|
+
) {
|
|
81
99
|
this._modelService = _modelService;
|
|
82
100
|
this._languageService = _languageService;
|
|
83
101
|
this._editorService = _editorService;
|
|
@@ -92,13 +110,17 @@ let PerfModelContentProvider = class PerfModelContentProvider {
|
|
|
92
110
|
provideTextContent(resource) {
|
|
93
111
|
if (!this._model || this._model.isDisposed()) {
|
|
94
112
|
dispose(this._modelDisposables);
|
|
95
|
-
const langId = this._languageService.createById(
|
|
96
|
-
this._model = this._modelService.getModel(resource) || this._modelService.createModel(
|
|
113
|
+
const langId = this._languageService.createById("markdown");
|
|
114
|
+
this._model = this._modelService.getModel(resource) || this._modelService.createModel("Loading...", langId, resource);
|
|
97
115
|
this._modelDisposables.push(langId.onDidChange(e => {
|
|
98
116
|
this._model?.setLanguage(e);
|
|
99
117
|
}));
|
|
100
|
-
this._modelDisposables.push(
|
|
101
|
-
|
|
118
|
+
this._modelDisposables.push(
|
|
119
|
+
this._extensionService.onDidChangeExtensionsStatus(this._updateModel, this)
|
|
120
|
+
);
|
|
121
|
+
writeTransientState(this._model, {
|
|
122
|
+
wordWrapOverride: "off"
|
|
123
|
+
}, this._editorService);
|
|
102
124
|
}
|
|
103
125
|
this._updateModel();
|
|
104
126
|
return Promise.resolve(this._model);
|
|
@@ -118,7 +140,11 @@ let PerfModelContentProvider = class PerfModelContentProvider {
|
|
|
118
140
|
md.blank();
|
|
119
141
|
this._addExtensionsTable(md);
|
|
120
142
|
md.blank();
|
|
121
|
-
this._addPerfMarksTable(
|
|
143
|
+
this._addPerfMarksTable(
|
|
144
|
+
"Terminal Stats",
|
|
145
|
+
md,
|
|
146
|
+
this._timerService.getPerformanceMarks().find(e => e[0] === "renderer")?.[1].filter(e => e.name.startsWith("code/terminal/"))
|
|
147
|
+
);
|
|
122
148
|
md.blank();
|
|
123
149
|
this._addWorkbenchContributionsPerfMarksTable(md);
|
|
124
150
|
md.blank();
|
|
@@ -131,17 +157,25 @@ let PerfModelContentProvider = class PerfModelContentProvider {
|
|
|
131
157
|
}
|
|
132
158
|
_addSummary(md) {
|
|
133
159
|
const metrics = this._timerService.startupMetrics;
|
|
134
|
-
md.heading(2,
|
|
135
|
-
md.li(
|
|
160
|
+
md.heading(2, "System Info");
|
|
161
|
+
md.li(
|
|
162
|
+
`${this._productService.nameShort}: ${this._productService.version} (${this._productService.commit || "0000000"})`
|
|
163
|
+
);
|
|
136
164
|
md.li(`OS: ${metrics.platform}(${metrics.release})`);
|
|
137
165
|
if (metrics.cpus) {
|
|
138
|
-
md.li(
|
|
166
|
+
md.li(
|
|
167
|
+
`CPUs: ${metrics.cpus.model}(${metrics.cpus.count} x ${metrics.cpus.speed})`
|
|
168
|
+
);
|
|
139
169
|
}
|
|
140
|
-
if (typeof metrics.totalmem ===
|
|
141
|
-
md.li(
|
|
170
|
+
if (typeof metrics.totalmem === "number" && typeof metrics.freemem === "number") {
|
|
171
|
+
md.li(
|
|
172
|
+
`Memory(System): ${(metrics.totalmem / (ByteSize.GB)).toFixed(2)} GB(${(metrics.freemem / (ByteSize.GB)).toFixed(2)}GB free)`
|
|
173
|
+
);
|
|
142
174
|
}
|
|
143
175
|
if (metrics.meminfo) {
|
|
144
|
-
md.li(
|
|
176
|
+
md.li(
|
|
177
|
+
`Memory(Process): ${(metrics.meminfo.workingSetSize / ByteSize.KB).toFixed(2)} MB working set(${(metrics.meminfo.privateBytes / ByteSize.KB).toFixed(2)}MB private, ${(metrics.meminfo.sharedBytes / ByteSize.KB).toFixed(2)}MB shared)`
|
|
178
|
+
);
|
|
145
179
|
}
|
|
146
180
|
md.li(`VM(likelihood): ${metrics.isVMLikelyhood}%`);
|
|
147
181
|
md.li(`Initial Startup: ${metrics.initialStartup}`);
|
|
@@ -153,57 +187,204 @@ let PerfModelContentProvider = class PerfModelContentProvider {
|
|
|
153
187
|
const metrics = this._timerService.startupMetrics;
|
|
154
188
|
const contribTimings = ( Registry.as(Extensions.Workbench)).timings;
|
|
155
189
|
const table = [];
|
|
156
|
-
table.push([
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
table.push([
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
table.push([
|
|
190
|
+
table.push([
|
|
191
|
+
"import(main.js)",
|
|
192
|
+
metrics.timers.ellapsedLoadMainBundle,
|
|
193
|
+
"[main]",
|
|
194
|
+
`initial startup: ${metrics.initialStartup}`
|
|
195
|
+
]);
|
|
196
|
+
table.push([
|
|
197
|
+
"start => app.isReady",
|
|
198
|
+
metrics.timers.ellapsedAppReady,
|
|
199
|
+
"[main]",
|
|
200
|
+
`initial startup: ${metrics.initialStartup}`
|
|
201
|
+
]);
|
|
202
|
+
table.push([
|
|
203
|
+
"nls:start => nls:end",
|
|
204
|
+
metrics.timers.ellapsedNlsGeneration,
|
|
205
|
+
"[main]",
|
|
206
|
+
`initial startup: ${metrics.initialStartup}`
|
|
207
|
+
]);
|
|
208
|
+
table.push([
|
|
209
|
+
"run main.js",
|
|
210
|
+
metrics.timers.ellapsedRunMainBundle,
|
|
211
|
+
"[main]",
|
|
212
|
+
`initial startup: ${metrics.initialStartup}`
|
|
213
|
+
]);
|
|
214
|
+
table.push([
|
|
215
|
+
"start crash reporter",
|
|
216
|
+
metrics.timers.ellapsedCrashReporter,
|
|
217
|
+
"[main]",
|
|
218
|
+
`initial startup: ${metrics.initialStartup}`
|
|
219
|
+
]);
|
|
220
|
+
table.push([
|
|
221
|
+
"serve main IPC handle",
|
|
222
|
+
metrics.timers.ellapsedMainServer,
|
|
223
|
+
"[main]",
|
|
224
|
+
`initial startup: ${metrics.initialStartup}`
|
|
225
|
+
]);
|
|
226
|
+
table.push([
|
|
227
|
+
"create window",
|
|
228
|
+
metrics.timers.ellapsedWindowCreate,
|
|
229
|
+
"[main]",
|
|
230
|
+
`initial startup: ${metrics.initialStartup}, ${metrics.initialStartup ? `state: ${metrics.timers.ellapsedWindowRestoreState}ms, widget: ${metrics.timers.ellapsedBrowserWindowCreate}ms, show: ${metrics.timers.ellapsedWindowMaximize}ms` : ""}`
|
|
231
|
+
]);
|
|
232
|
+
table.push([
|
|
233
|
+
"app.isReady => window.loadUrl()",
|
|
234
|
+
metrics.timers.ellapsedWindowLoad,
|
|
235
|
+
"[main]",
|
|
236
|
+
`initial startup: ${metrics.initialStartup}`
|
|
237
|
+
]);
|
|
238
|
+
table.push([
|
|
239
|
+
"window.loadUrl() => begin to import(workbench.desktop.main.js)",
|
|
240
|
+
metrics.timers.ellapsedWindowLoadToRequire,
|
|
241
|
+
"[main->renderer]",
|
|
242
|
+
StartupKindToString(metrics.windowKind)
|
|
243
|
+
]);
|
|
244
|
+
table.push([
|
|
245
|
+
"import(workbench.desktop.main.js)",
|
|
246
|
+
metrics.timers.ellapsedRequire,
|
|
247
|
+
"[renderer]",
|
|
248
|
+
`cached data: ${(metrics.didUseCachedData ? "YES" : "NO")}`
|
|
249
|
+
]);
|
|
250
|
+
table.push([
|
|
251
|
+
"wait for window config",
|
|
252
|
+
metrics.timers.ellapsedWaitForWindowConfig,
|
|
253
|
+
"[renderer]",
|
|
254
|
+
undefined
|
|
255
|
+
]);
|
|
256
|
+
table.push([
|
|
257
|
+
"init storage (global & workspace)",
|
|
258
|
+
metrics.timers.ellapsedStorageInit,
|
|
259
|
+
"[renderer]",
|
|
260
|
+
undefined
|
|
261
|
+
]);
|
|
262
|
+
table.push([
|
|
263
|
+
"init workspace service",
|
|
264
|
+
metrics.timers.ellapsedWorkspaceServiceInit,
|
|
265
|
+
"[renderer]",
|
|
266
|
+
undefined
|
|
267
|
+
]);
|
|
169
268
|
if (isWeb) {
|
|
170
|
-
table.push([
|
|
171
|
-
|
|
269
|
+
table.push([
|
|
270
|
+
"init settings and global state from settings sync service",
|
|
271
|
+
metrics.timers.ellapsedRequiredUserDataInit,
|
|
272
|
+
"[renderer]",
|
|
273
|
+
undefined
|
|
274
|
+
]);
|
|
275
|
+
table.push([
|
|
276
|
+
"init keybindings, snippets & extensions from settings sync service",
|
|
277
|
+
metrics.timers.ellapsedOtherUserDataInit,
|
|
278
|
+
"[renderer]",
|
|
279
|
+
undefined
|
|
280
|
+
]);
|
|
172
281
|
}
|
|
173
|
-
table.push([
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
table.push([
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
282
|
+
table.push([
|
|
283
|
+
"register extensions & spawn extension host",
|
|
284
|
+
metrics.timers.ellapsedExtensions,
|
|
285
|
+
"[renderer]",
|
|
286
|
+
undefined
|
|
287
|
+
]);
|
|
288
|
+
table.push([
|
|
289
|
+
"restore primary viewlet",
|
|
290
|
+
metrics.timers.ellapsedViewletRestore,
|
|
291
|
+
"[renderer]",
|
|
292
|
+
metrics.viewletId
|
|
293
|
+
]);
|
|
294
|
+
table.push([
|
|
295
|
+
"restore secondary viewlet",
|
|
296
|
+
metrics.timers.ellapsedAuxiliaryViewletRestore,
|
|
297
|
+
"[renderer]",
|
|
298
|
+
metrics.auxiliaryViewletId
|
|
299
|
+
]);
|
|
300
|
+
table.push([
|
|
301
|
+
"restore panel",
|
|
302
|
+
metrics.timers.ellapsedPanelRestore,
|
|
303
|
+
"[renderer]",
|
|
304
|
+
metrics.panelId
|
|
305
|
+
]);
|
|
306
|
+
table.push([
|
|
307
|
+
"restore & resolve visible editors",
|
|
308
|
+
metrics.timers.ellapsedEditorRestore,
|
|
309
|
+
"[renderer]",
|
|
310
|
+
`${metrics.editorIds.length}: ${metrics.editorIds.join(", ")}`
|
|
311
|
+
]);
|
|
312
|
+
table.push([
|
|
313
|
+
"create workbench contributions",
|
|
314
|
+
metrics.timers.ellapsedWorkbenchContributions,
|
|
315
|
+
"[renderer]",
|
|
316
|
+
`${(contribTimings.get(LifecyclePhase.Starting)?.length ?? 0) + (contribTimings.get(LifecyclePhase.Starting)?.length ?? 0)} blocking startup`
|
|
317
|
+
]);
|
|
318
|
+
table.push([
|
|
319
|
+
"overall workbench load",
|
|
320
|
+
metrics.timers.ellapsedWorkbench,
|
|
321
|
+
"[renderer]",
|
|
322
|
+
undefined
|
|
323
|
+
]);
|
|
324
|
+
table.push(["workbench ready", metrics.ellapsed, "[main->renderer]", undefined]);
|
|
325
|
+
table.push(
|
|
326
|
+
["renderer ready", metrics.timers.ellapsedRenderer, "[renderer]", undefined]
|
|
327
|
+
);
|
|
328
|
+
table.push([
|
|
329
|
+
"shared process connection ready",
|
|
330
|
+
metrics.timers.ellapsedSharedProcesConnected,
|
|
331
|
+
"[renderer->sharedprocess]",
|
|
332
|
+
undefined
|
|
333
|
+
]);
|
|
334
|
+
table.push([
|
|
335
|
+
"extensions registered",
|
|
336
|
+
metrics.timers.ellapsedExtensionsReady,
|
|
337
|
+
"[renderer]",
|
|
338
|
+
undefined
|
|
339
|
+
]);
|
|
340
|
+
md.heading(2, "Performance Marks");
|
|
341
|
+
md.table(["What", "Duration", "Process", "Info"], table);
|
|
186
342
|
}
|
|
187
343
|
_addExtensionsTable(md) {
|
|
188
344
|
const eager = [];
|
|
189
345
|
const normal = [];
|
|
190
346
|
const extensionsStatus = this._extensionService.getExtensionsStatus();
|
|
191
347
|
for (const id in extensionsStatus) {
|
|
192
|
-
const {
|
|
348
|
+
const {
|
|
349
|
+
activationTimes: times
|
|
350
|
+
} = extensionsStatus[id];
|
|
193
351
|
if (!times) {
|
|
194
352
|
continue;
|
|
195
353
|
}
|
|
196
354
|
if (times.activationReason.startup) {
|
|
197
|
-
eager.push([
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
355
|
+
eager.push([
|
|
356
|
+
id,
|
|
357
|
+
times.activationReason.startup,
|
|
358
|
+
times.codeLoadingTime,
|
|
359
|
+
times.activateCallTime,
|
|
360
|
+
times.activateResolvedTime,
|
|
361
|
+
times.activationReason.activationEvent,
|
|
362
|
+
times.activationReason.extensionId.value
|
|
363
|
+
]);
|
|
364
|
+
} else {
|
|
365
|
+
normal.push([
|
|
366
|
+
id,
|
|
367
|
+
times.activationReason.startup,
|
|
368
|
+
times.codeLoadingTime,
|
|
369
|
+
times.activateCallTime,
|
|
370
|
+
times.activateResolvedTime,
|
|
371
|
+
times.activationReason.activationEvent,
|
|
372
|
+
times.activationReason.extensionId.value
|
|
373
|
+
]);
|
|
201
374
|
}
|
|
202
375
|
}
|
|
203
376
|
const table = eager.concat(normal);
|
|
204
377
|
if (table.length > 0) {
|
|
205
|
-
md.heading(2,
|
|
206
|
-
md.table([
|
|
378
|
+
md.heading(2, "Extension Activation Stats");
|
|
379
|
+
md.table([
|
|
380
|
+
"Extension",
|
|
381
|
+
"Eager",
|
|
382
|
+
"Load Code",
|
|
383
|
+
"Call Activate",
|
|
384
|
+
"Finish Activate",
|
|
385
|
+
"Event",
|
|
386
|
+
"By"
|
|
387
|
+
], table);
|
|
207
388
|
}
|
|
208
389
|
}
|
|
209
390
|
_addPerfMarksTable(name, md, marks) {
|
|
@@ -213,7 +394,10 @@ let PerfModelContentProvider = class PerfModelContentProvider {
|
|
|
213
394
|
const table = [];
|
|
214
395
|
let lastStartTime = -1;
|
|
215
396
|
let total = 0;
|
|
216
|
-
for (const {
|
|
397
|
+
for (const {
|
|
398
|
+
name,
|
|
399
|
+
startTime
|
|
400
|
+
} of marks) {
|
|
217
401
|
const delta = lastStartTime !== -1 ? startTime - lastStartTime : 0;
|
|
218
402
|
total += delta;
|
|
219
403
|
table.push([name, Math.round(startTime), Math.round(delta), Math.round(total)]);
|
|
@@ -222,68 +406,64 @@ let PerfModelContentProvider = class PerfModelContentProvider {
|
|
|
222
406
|
if (name) {
|
|
223
407
|
md.heading(2, name);
|
|
224
408
|
}
|
|
225
|
-
md.table([
|
|
409
|
+
md.table(["Name", "Timestamp", "Delta", "Total"], table);
|
|
226
410
|
}
|
|
227
411
|
_addWorkbenchContributionsPerfMarksTable(md) {
|
|
228
|
-
md.heading(2,
|
|
412
|
+
md.heading(2, "Workbench Contributions Blocking Restore");
|
|
229
413
|
const timings = ( Registry.as(Extensions.Workbench)).timings;
|
|
230
|
-
md.li(
|
|
231
|
-
|
|
414
|
+
md.li(
|
|
415
|
+
`Total (LifecyclePhase.Starting): ${timings.get(LifecyclePhase.Starting)?.length} (${timings.get(LifecyclePhase.Starting)?.reduce((p, c) => p + c[1], 0)}ms)`
|
|
416
|
+
);
|
|
417
|
+
md.li(
|
|
418
|
+
`Total (LifecyclePhase.Ready): ${timings.get(LifecyclePhase.Ready)?.length} (${timings.get(LifecyclePhase.Ready)?.reduce((p, c) => p + c[1], 0)}ms)`
|
|
419
|
+
);
|
|
232
420
|
md.blank();
|
|
233
|
-
const marks = this._timerService.getPerformanceMarks().find(e => e[0] ===
|
|
234
|
-
e.name.startsWith(
|
|
235
|
-
|
|
236
|
-
e.name.startsWith('code/didCreateWorkbenchContribution/2'));
|
|
421
|
+
const marks = this._timerService.getPerformanceMarks().find(e => e[0] === "renderer")?.[1].filter(
|
|
422
|
+
e => e.name.startsWith("code/willCreateWorkbenchContribution/1") || e.name.startsWith("code/didCreateWorkbenchContribution/1") || e.name.startsWith("code/willCreateWorkbenchContribution/2") || e.name.startsWith("code/didCreateWorkbenchContribution/2")
|
|
423
|
+
);
|
|
237
424
|
this._addPerfMarksTable(undefined, md, marks);
|
|
238
425
|
}
|
|
239
426
|
_addRawPerfMarks(md) {
|
|
240
427
|
for (const [source, marks] of this._timerService.getPerformanceMarks()) {
|
|
241
428
|
md.heading(2, `Raw Perf Marks: ${source}`);
|
|
242
|
-
md.value +=
|
|
429
|
+
md.value += "```\n";
|
|
243
430
|
md.value += `Name\tTimestamp\tDelta\tTotal\n`;
|
|
244
431
|
let lastStartTime = -1;
|
|
245
432
|
let total = 0;
|
|
246
|
-
for (const {
|
|
433
|
+
for (const {
|
|
434
|
+
name,
|
|
435
|
+
startTime
|
|
436
|
+
} of marks) {
|
|
247
437
|
const delta = lastStartTime !== -1 ? startTime - lastStartTime : 0;
|
|
248
438
|
total += delta;
|
|
249
439
|
md.value += `${name}\t${startTime}\t${delta}\t${total}\n`;
|
|
250
440
|
lastStartTime = startTime;
|
|
251
441
|
}
|
|
252
|
-
md.value +=
|
|
442
|
+
md.value += "```\n";
|
|
253
443
|
}
|
|
254
444
|
}
|
|
255
445
|
_addResourceTimingStats(md) {
|
|
256
|
-
const stats = ( mainWindow.performance.getEntriesByType(
|
|
446
|
+
const stats = ( mainWindow.performance.getEntriesByType("resource").map(entry => {
|
|
257
447
|
return [entry.name, entry.duration];
|
|
258
448
|
}));
|
|
259
449
|
if (!stats.length) {
|
|
260
450
|
return;
|
|
261
451
|
}
|
|
262
|
-
md.heading(2,
|
|
263
|
-
md.table([
|
|
452
|
+
md.heading(2, "Resource Timing Stats");
|
|
453
|
+
md.table(["Name", "Duration"], stats);
|
|
264
454
|
}
|
|
265
455
|
};
|
|
266
|
-
PerfModelContentProvider = ( __decorate([
|
|
267
|
-
( __param(0, IModelService)),
|
|
268
|
-
( __param(1, ILanguageService)),
|
|
269
|
-
( __param(2, ICodeEditorService)),
|
|
270
|
-
( __param(3, ILifecycleService)),
|
|
271
|
-
( __param(4, ITimerService)),
|
|
272
|
-
( __param(5, IExtensionService)),
|
|
273
|
-
( __param(6, IProductService)),
|
|
274
|
-
( __param(7, IRemoteAgentService)),
|
|
275
|
-
( __param(8, ITerminalService))
|
|
276
|
-
], PerfModelContentProvider));
|
|
456
|
+
PerfModelContentProvider = ( __decorate([( __param(0, IModelService)), ( __param(1, ILanguageService)), ( __param(2, ICodeEditorService)), ( __param(3, ILifecycleService)), ( __param(4, ITimerService)), ( __param(5, IExtensionService)), ( __param(6, IProductService)), ( __param(7, IRemoteAgentService)), ( __param(8, ITerminalService))], PerfModelContentProvider));
|
|
277
457
|
class MarkdownBuilder {
|
|
278
458
|
constructor() {
|
|
279
|
-
this.value =
|
|
459
|
+
this.value = "";
|
|
280
460
|
}
|
|
281
461
|
heading(level, value) {
|
|
282
|
-
this.value += `${
|
|
462
|
+
this.value += `${"#".repeat(level)} ${value}\n\n`;
|
|
283
463
|
return this;
|
|
284
464
|
}
|
|
285
465
|
blank() {
|
|
286
|
-
this.value +=
|
|
466
|
+
this.value += "\n";
|
|
287
467
|
return this;
|
|
288
468
|
}
|
|
289
469
|
li(value) {
|
|
@@ -294,31 +474,35 @@ class MarkdownBuilder {
|
|
|
294
474
|
this.value += this.toMarkdownTable(header, rows);
|
|
295
475
|
}
|
|
296
476
|
toMarkdownTable(header, rows) {
|
|
297
|
-
let result =
|
|
477
|
+
let result = "";
|
|
298
478
|
const lengths = [];
|
|
299
479
|
header.forEach((cell, ci) => {
|
|
300
480
|
lengths[ci] = cell.length;
|
|
301
481
|
});
|
|
302
482
|
rows.forEach(row => {
|
|
303
483
|
row.forEach((cell, ci) => {
|
|
304
|
-
if (typeof cell ===
|
|
305
|
-
cell = row[ci] =
|
|
484
|
+
if (typeof cell === "undefined") {
|
|
485
|
+
cell = row[ci] = "-";
|
|
306
486
|
}
|
|
307
487
|
const len = ( cell.toString()).length;
|
|
308
488
|
lengths[ci] = Math.max(len, lengths[ci]);
|
|
309
489
|
});
|
|
310
490
|
});
|
|
311
|
-
header.forEach((cell, ci) => {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
result +=
|
|
491
|
+
header.forEach((cell, ci) => {
|
|
492
|
+
result += `| ${cell + " ".repeat(lengths[ci] - ( cell.toString()).length)} `;
|
|
493
|
+
});
|
|
494
|
+
result += "|\n";
|
|
495
|
+
header.forEach((_cell, ci) => {
|
|
496
|
+
result += `| ${"-".repeat(lengths[ci])} `;
|
|
497
|
+
});
|
|
498
|
+
result += "|\n";
|
|
315
499
|
rows.forEach(row => {
|
|
316
500
|
row.forEach((cell, ci) => {
|
|
317
|
-
if (typeof cell !==
|
|
318
|
-
result += `| ${cell +
|
|
501
|
+
if (typeof cell !== "undefined") {
|
|
502
|
+
result += `| ${cell + " ".repeat(lengths[ci] - ( cell.toString()).length)} `;
|
|
319
503
|
}
|
|
320
504
|
});
|
|
321
|
-
result +=
|
|
505
|
+
result += "|\n";
|
|
322
506
|
});
|
|
323
507
|
return result;
|
|
324
508
|
}
|
|
@@ -19,7 +19,13 @@ import { hash } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hash';
|
|
|
19
19
|
import { mainWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/window';
|
|
20
20
|
|
|
21
21
|
let StartupTimings = class StartupTimings {
|
|
22
|
-
constructor(
|
|
22
|
+
constructor(
|
|
23
|
+
_editorService,
|
|
24
|
+
_paneCompositeService,
|
|
25
|
+
_lifecycleService,
|
|
26
|
+
_updateService,
|
|
27
|
+
_workspaceTrustService
|
|
28
|
+
) {
|
|
23
29
|
this._editorService = _editorService;
|
|
24
30
|
this._paneCompositeService = _paneCompositeService;
|
|
25
31
|
this._lifecycleService = _lifecycleService;
|
|
@@ -31,18 +37,18 @@ let StartupTimings = class StartupTimings {
|
|
|
31
37
|
return StartupKindToString(this._lifecycleService.startupKind);
|
|
32
38
|
}
|
|
33
39
|
if (!this._workspaceTrustService.isWorkspaceTrusted()) {
|
|
34
|
-
return
|
|
40
|
+
return "Workspace not trusted";
|
|
35
41
|
}
|
|
36
42
|
const activeViewlet = this._paneCompositeService.getActivePaneComposite(ViewContainerLocation.Sidebar);
|
|
37
43
|
if (!activeViewlet || activeViewlet.getId() !== VIEWLET_ID) {
|
|
38
|
-
return
|
|
44
|
+
return "Explorer viewlet not visible";
|
|
39
45
|
}
|
|
40
46
|
const visibleEditorPanes = this._editorService.visibleEditorPanes;
|
|
41
47
|
if (visibleEditorPanes.length !== 1) {
|
|
42
48
|
return `Expected text editor count : 1, Actual : ${visibleEditorPanes.length}`;
|
|
43
49
|
}
|
|
44
50
|
if (!isCodeEditor(visibleEditorPanes[0].getControl())) {
|
|
45
|
-
return
|
|
51
|
+
return "Active editor is not a text editor";
|
|
46
52
|
}
|
|
47
53
|
const activePanel = this._paneCompositeService.getActivePaneComposite(ViewContainerLocation.Panel);
|
|
48
54
|
if (activePanel) {
|
|
@@ -50,21 +56,32 @@ let StartupTimings = class StartupTimings {
|
|
|
50
56
|
}
|
|
51
57
|
const isLatestVersion = await this._updateService.isLatestVersion();
|
|
52
58
|
if (isLatestVersion === false) {
|
|
53
|
-
return
|
|
59
|
+
return "Not on latest version, updates available";
|
|
54
60
|
}
|
|
55
61
|
return undefined;
|
|
56
62
|
}
|
|
57
63
|
};
|
|
58
|
-
StartupTimings = ( __decorate([
|
|
59
|
-
( __param(0, IEditorService)),
|
|
60
|
-
( __param(1, IPaneCompositePartService)),
|
|
61
|
-
( __param(2, ILifecycleService)),
|
|
62
|
-
( __param(3, IUpdateService)),
|
|
63
|
-
( __param(4, IWorkspaceTrustManagementService))
|
|
64
|
-
], StartupTimings));
|
|
64
|
+
StartupTimings = ( __decorate([( __param(0, IEditorService)), ( __param(1, IPaneCompositePartService)), ( __param(2, ILifecycleService)), ( __param(3, IUpdateService)), ( __param(4, IWorkspaceTrustManagementService))], StartupTimings));
|
|
65
65
|
let BrowserStartupTimings = class BrowserStartupTimings extends StartupTimings {
|
|
66
|
-
constructor(
|
|
67
|
-
|
|
66
|
+
constructor(
|
|
67
|
+
editorService,
|
|
68
|
+
paneCompositeService,
|
|
69
|
+
lifecycleService,
|
|
70
|
+
updateService,
|
|
71
|
+
workspaceTrustService,
|
|
72
|
+
timerService,
|
|
73
|
+
logService,
|
|
74
|
+
environmentService,
|
|
75
|
+
telemetryService,
|
|
76
|
+
productService
|
|
77
|
+
) {
|
|
78
|
+
super(
|
|
79
|
+
editorService,
|
|
80
|
+
paneCompositeService,
|
|
81
|
+
lifecycleService,
|
|
82
|
+
updateService,
|
|
83
|
+
workspaceTrustService
|
|
84
|
+
);
|
|
68
85
|
this.timerService = timerService;
|
|
69
86
|
this.logService = logService;
|
|
70
87
|
this.environmentService = environmentService;
|
|
@@ -80,41 +97,26 @@ let BrowserStartupTimings = class BrowserStartupTimings extends StartupTimings {
|
|
|
80
97
|
const standardStartupError = await this._isStandardStartup();
|
|
81
98
|
const perfBaseline = await this.timerService.perfBaseline;
|
|
82
99
|
const [from, to] = this.environmentService.profDurationMarkers;
|
|
83
|
-
const content = `${this.timerService.getDuration(from, to)}\t${this.productService.nameShort}\t${(this.productService.commit ||
|
|
100
|
+
const content = `${this.timerService.getDuration(from, to)}\t${this.productService.nameShort}\t${(this.productService.commit || "").slice(0, 10) || "0000000000"}\t${this.telemetryService.sessionId}\t${standardStartupError === undefined ? "standard_start" : "NO_standard_start : " + standardStartupError}\t${String(perfBaseline).padStart(4, "0")}ms\n`;
|
|
84
101
|
this.logService.info(`[prof-timers] ${content}`);
|
|
85
102
|
}
|
|
86
103
|
};
|
|
87
|
-
BrowserStartupTimings = ( __decorate([
|
|
88
|
-
( __param(0, IEditorService)),
|
|
89
|
-
( __param(1, IPaneCompositePartService)),
|
|
90
|
-
( __param(2, ILifecycleService)),
|
|
91
|
-
( __param(3, IUpdateService)),
|
|
92
|
-
( __param(4, IWorkspaceTrustManagementService)),
|
|
93
|
-
( __param(5, ITimerService)),
|
|
94
|
-
( __param(6, ILogService)),
|
|
95
|
-
( __param(7, IBrowserWorkbenchEnvironmentService)),
|
|
96
|
-
( __param(8, ITelemetryService)),
|
|
97
|
-
( __param(9, IProductService))
|
|
98
|
-
], BrowserStartupTimings));
|
|
104
|
+
BrowserStartupTimings = ( __decorate([( __param(0, IEditorService)), ( __param(1, IPaneCompositePartService)), ( __param(2, ILifecycleService)), ( __param(3, IUpdateService)), ( __param(4, IWorkspaceTrustManagementService)), ( __param(5, ITimerService)), ( __param(6, ILogService)), ( __param(7, IBrowserWorkbenchEnvironmentService)), ( __param(8, ITelemetryService)), ( __param(9, IProductService))], BrowserStartupTimings));
|
|
99
105
|
let BrowserResourcePerformanceMarks = class BrowserResourcePerformanceMarks {
|
|
100
106
|
constructor(telemetryService) {
|
|
101
|
-
for (const item of mainWindow.performance.getEntriesByType(
|
|
107
|
+
for (const item of mainWindow.performance.getEntriesByType("resource")) {
|
|
102
108
|
try {
|
|
103
109
|
const url = ( new URL(item.name));
|
|
104
110
|
const name = posix.basename(url.pathname);
|
|
105
|
-
telemetryService.publicLog2(
|
|
111
|
+
telemetryService.publicLog2("startup.resource.perf", {
|
|
106
112
|
hosthash: `H${( hash(url.host).toString(16))}`,
|
|
107
113
|
name,
|
|
108
114
|
duration: item.duration
|
|
109
115
|
});
|
|
110
|
-
}
|
|
111
|
-
catch {
|
|
112
|
-
}
|
|
116
|
+
} catch {}
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
119
|
};
|
|
116
|
-
BrowserResourcePerformanceMarks = ( __decorate([
|
|
117
|
-
( __param(0, ITelemetryService))
|
|
118
|
-
], BrowserResourcePerformanceMarks));
|
|
120
|
+
BrowserResourcePerformanceMarks = ( __decorate([( __param(0, ITelemetryService))], BrowserResourcePerformanceMarks));
|
|
119
121
|
|
|
120
122
|
export { BrowserResourcePerformanceMarks, BrowserStartupTimings, StartupTimings };
|