Skip to content

Commit

Permalink
Commit profiles to Github
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartik Raj committed Sep 21, 2023
1 parent 79fdd4d commit 4f73c81
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions discovery_fresh_startup.cpuprofile

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ls_full_load_with_discovery.cpuprofile

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ls_full_load_without_discovery.cpuprofile

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ls_with_discovery_partial_proposal.cpuprofile

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ls_with_discovery_proposal.cpuprofile

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/client/common/process/rawProcessApis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ export function plainExec(
): Promise<ExecutionResult<string>> {
const spawnOptions = getDefaultOptions(options, defaultEnv);
const encoding = spawnOptions.encoding ? spawnOptions.encoding : 'utf8';
console.time(`Time to launch process ${file} ${JSON.stringify(args)}`);
const proc = spawn(file, args, spawnOptions);
console.log(proc.pid)
console.timeLog(`Time to launch process ${file} ${JSON.stringify(args)}`);
// Listen to these errors (unhandled errors in streams tears down the process).
// Errors will be bubbled up to the `error` event in `proc`, hence no need to log.
proc.stdout?.on('error', noop);
Expand Down Expand Up @@ -153,6 +156,7 @@ export function plainExec(
} else {
let stdout = decodeBuffer(stdoutBuffers, encoding);
stdout = filterOutputUsingCondaRunMarkers(stdout);
console.timeEnd(`Time to launch process ${file} ${JSON.stringify(args)}`);
deferred.resolve({ stdout, stderr });
}
internalDisposables.forEach((d) => d.dispose());
Expand Down
1 change: 1 addition & 0 deletions src/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export async function activate(context: IExtensionContext): Promise<PythonExtens
let api: PythonExtension;
let ready: Promise<void>;
let serviceContainer: IServiceContainer;
console.log('Start stopwatch');
try {
const workspaceService = new WorkspaceService();
context.subscriptions.push(
Expand Down
3 changes: 3 additions & 0 deletions src/client/languageServer/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ export class LanguageServerWatcher implements IExtensionActivationService, ILang

if (languageServerExtensionManager.canStartLanguageServer(interpreter)) {
// Start the language server.
console.timeEnd('Language server started');
console.time('Time taken to start Language server');
await languageServerExtensionManager.startLanguageServer(lsResource, interpreter);
console.timeEnd('Time taken to start Language server');

logStartup(languageServerType, lsResource);
this.languageServerType = languageServerType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ export class Conda {
if (shellPath) {
options.shell = shellPath;
}
console.log('Conda binary exec started', performance.now());
const result = await exec(command, ['info', '--json'], options);
console.log('Conda binary exec ended', performance.now());
traceVerbose(`${command} info --json: ${result.stdout}`);
return JSON.parse(result.stdout);
}
Expand Down
4 changes: 4 additions & 0 deletions src/client/pythonEnvironments/common/windowsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ export async function getInterpreterDataFromRegistry(
hive: string,
key: string,
): Promise<IRegistryInterpreterData[]> {
console.time(`Windows registry look up for ${key}`);
const subKeys = await readRegistryKeys({ arch, hive, key });
const distroOrgName = key.substr(key.lastIndexOf('\\') + 1);
const allData = await Promise.all(subKeys.map((subKey) => getInterpreterDataFromKey(subKey, distroOrgName)));
console.timeEnd(`Windows registry look up for ${key}`);
return (allData.filter((data) => data !== undefined) || []) as IRegistryInterpreterData[];
}

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

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

for (const arch of ['x64', 'x86']) {
Expand All @@ -149,5 +152,6 @@ async function getRegistryInterpretersImpl(): Promise<IRegistryInterpreterData[]
}
}
registryInterpretersCache = uniqBy(registryData, (r: IRegistryInterpreterData) => r.interpreterPath);
console.timeEnd('Windows registry discovery');
return registryInterpretersCache;
}
2 changes: 1 addition & 1 deletion src/client/pythonEnvironments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function activate(api: IDiscoveryAPI, ext: ExtensionState): Promise
*/
const folders = vscode.workspace.workspaceFolders;
// Trigger discovery if environment cache is empty.
const wasTriggered = getGlobalStorage<PythonEnvInfo[]>(ext.context, 'PYTHON_ENV_INFO_CACHE', []).get().length > 0;
const wasTriggered = false;
if (!wasTriggered) {
api.triggerRefresh().ignoreErrors();
folders?.forEach(async (folder) => {
Expand Down

0 comments on commit 4f73c81

Please sign in to comment.