Skip to content

Commit

Permalink
print raw performance marks, #41712
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed May 2, 2018
1 parent fe49af2 commit 6be579c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 23 deletions.
5 changes: 0 additions & 5 deletions src/vs/base/common/performance.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
*/
Expand Down
7 changes: 0 additions & 7 deletions src/vs/base/common/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -139,7 +133,6 @@ define([], function () {
var exports = {
mark: mark,
measure: measure,
time: time,
getEntries: getEntries,
getEntry: getEntry,
getDuration: getDuration,
Expand Down
7 changes: 3 additions & 4 deletions src/vs/workbench/electron-browser/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 6be579c

Please sign in to comment.