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

print raw performance marks, #41712

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