8000 Commit profiles to Github · microsoft/vscode-python@4f73c81 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4f73c81

Browse files
author
Kartik Raj
committed
Commit profiles to Github
1 parent 79fdd4d commit 4f73c81

11 files changed

+20
-1
lines changed

discovery_fresh_startup.cpuprofile

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

ls_full_load_with_discovery.cpuprofile

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

ls_full_load_without_discovery.cpuprofile

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

ls_with_discovery_partial_proposal.cpuprofile

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

ls_with_discovery_proposal.cpuprofile

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

src/client/common/process/rawProcessApis.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ export function plainExec(
9292
): Promise<ExecutionResult<string>> {
9393
const spawnOptions = getDefaultOptions(options, defaultEnv);
9494
const encoding = spawnOptions.encoding ? spawnOptions.encoding : 'utf8';
95+
console.time(`Time to launch process ${file} ${JSON.stringify(args)}`);
9596
const proc = spawn(file, args, spawnOptions);
97+
console.log(proc.pid)
98+
console.timeLog(`Time to launch process ${file} ${JSON.stringify(args)}`);
9699
// Listen to these errors (unhandled errors in streams tears down the process).
97100
// Errors will be bubbled up to the `error` event in `proc`, hence no need to log.
98101
proc.stdout?.on('error', noop);
@@ -153,6 +156,7 @@ export 8000 function plainExec(
153156
} else {
154157
let stdout = decodeBuffer(stdoutBuffers, encoding);
155158
stdout = filterOutputUsingCondaRunMarkers(stdout);
159+
console.timeEnd(`Time to launch process ${file} ${JSON.stringify(args)}`);
156160
deferred.resolve({ stdout, stderr });
157161
}
158162
internalDisposables.forEach((d) => d.dispose());

src/client/extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export async function activate(context: IExtensionContext): Promise<PythonExtens
6262
let api: PythonExtension;
6363
let ready: Promise<void>;
6464
let serviceContainer: IServiceContainer;
65+
console.log('Start stopwatch');
6566
try {
6667
const workspaceService = new WorkspaceService();
6768
context.subscriptions.push(

src/client/languageServer/watcher.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ export class LanguageServerWatcher implements IExtensionActivationService, ILang
170170

171171
if (languageServerExtensionManager.canStartLanguageServer(interpreter)) {
172172
// Start the language server.
173+
console.timeEnd('Language server started');
174+
console.time('Time taken to start Language server');
173175
await languageServerExtensionManager.startLanguageServer(lsResource, interpreter);
176+
console.timeEnd('Time taken to start Language server');
174177

175178
logStartup(languageServerType, lsResource);
176179
this.languageServerType = languageServerType;

src/client/pythonEnvironments/common/environmentManagers/conda.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,9 @@ export class Conda {
439439
if (shellPath) {
440440
options.shell = shellPath;
441441
}
442+
console.log('Conda binary exec started', performance.now());
442443
const result = await exec(command, ['info', '--json'], options);
444+
console.log('Conda binary exec ended', performance.now());
443445
traceVerbose(`${command} info --json: ${result.stdout}`);
444446
return JSON.parse(result.stdout);
445447
}

src/client/pythonEnvironments/common/windowsUtils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ export async function getInterpreterDataFromRegistry(
104104
hive: string,
105105
key: string,
106106
): Promise<IRegistryInterpreterData[]> {
107+
console.time(`Windows registry look up for ${key}`);
107108
const subKeys = await readRegistryKeys({ arch, hive, key });
108109
const distroOrgName = key.substr(key.lastIndexOf('\\') + 1);
109110
const allData = await Promise.all(subKeys.map((subKey) => getInterpreterDataFromKey(subKey, distroOrgName)));
111+
console.timeEnd(`Windows registry look up for ${key}`);
110112
return (allData.filter((data) => data !== undefined) || []) as IRegistryInterpreterData[];
111113
}
112114

@@ -131,6 +133,7 @@ export async function getRegistryInterpreters(): Promise<IRegistryInterpreterDat
131133
}
132134

133135
async function getRegistryInterpretersImpl(): Promise<IRegistryInterpreterData[]> {
136+
console.time('Windows registry discovery');
134137
let registryData: IRegistryInterpreterData[] = [];
135138

136139
for (const arch of ['x64', 'x86']) {
@@ -149,5 +152,6 @@ async function getRegistryInterpretersImpl(): Promise<IRegistryInterpreterData[]
149152
}
150153
}
151154
registryInterpretersCache = uniqBy(registryData, (r: IRegistryInterpreterData) => r.interpreterPath);
155+
console.timeEnd('Windows registry discovery');
152156
return registryInterpretersCache;
153157
}

0 commit comments

Comments
 (0)
0