-
-
Notifications
You must be signed in to change notification settings - Fork 257
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
NVIMPluginController.init() sometimes takes ~5s to finish execution on my computer (1.8 Ghz but still)
So I went along and measured how long each await in NVIMPluginController.init() takes in a very stupid way
export const logTime = (label: string) => {
console.log(label + " ");
console.timeLog("label");
};public async init(): Promise<void> {
logTime("init");
let resolveInitPromise: () => void = () => {
/* ignore */
};
this.nvimInitPromise = new Promise(res => {
resolveInitPromise = res;
});
await this.client.setClientInfo("vscode-neovim", { major: 0, minor: 1, patch: 0 }, "embedder", {}, {});
logTime("setClientInfo");
const channel = await this.client.channelId;
logTime("channelId");Output console of running vscode-neovim with the above logTime() calls - timings etc.
(There's lots of unnecessary output there, the format for the logTime() is:
functionName or whatever
label: [time in ms since start of activate() in extension.ts and end of execution of above function in line above]
but sometimes it outputs only the label: timeInMs for some reason
So if you round up the above data, here are the timings of the init() awaits chronologically (I omitted some functions that were very fast):
await this.client.setClientInfo("vscode-neovim", { major: 0, minor: 1, patch: 0 }, "embedder", {}, {});- 174msconst channel = await this.client.channelId- 1301 ms Δ1100ms - this is from the node neovim client. Link to code in neovim node-client code snippetawait this.client.setVar("vscode_channel", channel);- 1601ms Δ300msawait this.client.uiAttach(...)2503ms Δ900ms Link to neovim node-clientconst firstWin = await this.client.window;- 2865ms Δ350msawait this.client.callAtomic(winOptionsRequests)- 3747ms Δ900ms(counts all calls in for loop cumulatively) await.thisBuffer(e)- 4200ms Δ450msawait this.onChangedActiveEditor(vscode.window.activeTextEditor- 5200ms Δ1000ms
The above was performed on commit 68f056b4c9cb6b2559baa917f8c02166abd86f11 (vscode-neovim v0.5)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request