提交 6be579cd 编写于 作者: J Johannes Rieken

print raw performance marks, #41712

上级 fe49af2c
......@@ -14,11 +14,6 @@ export function mark(name: string): void;
export function measure(name: string, from?: string, to?: string): PerformanceEntry;
/**
* Time something, shorthant for `mark` and `measure`
*/
export function time(name: string): { stop(): void };
/**
* All entries filtered by type and sorted by `startTime`.
*/
......
......@@ -98,12 +98,6 @@ define([], function () {
}
}
function time(name) {
let from = `${name}/start`;
mark(from);
return { stop() { measure(name, from); } };
}
function measure(name, from, to) {
let startTime;
......@@ -139,7 +133,6 @@ define([], function () {
var exports = {
mark: mark,
measure: measure,
time: time,
getEntries: getEntries,
getEntry: getEntry,
getDuration: getDuration,
......
......@@ -352,11 +352,10 @@ export class ShowStartupPerformance extends Action {
(<any>console).groupEnd();
(<any>console).group('Raw Startup Timers (CSV)');
let value = `Name\tStart\tDuration\n`;
const entries = getEntries('measure');
let offset = entries[0].startTime;
let value = `Name\tStart\n`;
let entries = getEntries('mark').slice(0).sort((a, b) => a.startTime - b.startTime);
for (const entry of entries) {
value += `${entry.name}\t${entry.startTime - offset}\t${entry.duration}\n`;
value += `${entry.name}\t${entry.startTime}\n`;
}
console.log(value);
(<any>console).groupEnd();
......
......@@ -32,7 +32,7 @@ import { IMessagePassingProtocol } from 'vs/base/parts/ipc/common/ipc';
import { ExtHostCustomersRegistry } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IWindowService } from 'vs/platform/windows/common/windows';
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
import { mark, time } from 'vs/base/common/performance';
import { mark } from 'vs/base/common/performance';
import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { Barrier } from 'vs/base/common/async';
import { Event, Emitter } from 'vs/base/common/event';
......@@ -508,12 +508,7 @@ export class ExtensionService extends Disposable implements IExtensionService {
let messageHandler = (msg: IMessage) => this._handleExtensionPointMessage(msg);
for (let i = 0, len = extensionPoints.length; i < len; i++) {
const clock = time(`handleExtensionPoint:${extensionPoints[i].name}`);
try {
ExtensionService._handleExtensionPoint(extensionPoints[i], availableExtensions, messageHandler);
} finally {
clock.stop();
}
ExtensionService._handleExtensionPoint(extensionPoints[i], availableExtensions, messageHandler);
}
mark('extensionHostReady');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册