You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Slow spawn from ext host process when built from sources #132654
Does this issue occur when all extensions are disabled?: Yes/No
VS Code Version: 1.60.1
OS Version: Darwin x64 20.6.0
We noticed that vscode which is built locally, started to work much slower than previous version. Profiling shown that spawns take much more time than before (15ms vs 300-1500ms). One of the most notable places is getHead in the git extension.
Steps to Reproduce:
Checkout release 1.60
Go to extensions/git/src/git.ts
Add a measuring around the getHead() method
Locally compile vs code, and open the same repo
You will have getHead taking around 300ms
If you will do it, say on 1.55, it will much less than that (15ms)
On 1.55, it took much less (~15ms). It seems that it's caused by libuv/libuv#3050 which was reverted due to broken tests (libuv/libuv#3050 (comment)). It seems that vscode uses patched version of electron (is it true?). Is it possible that you share the patched electron with the community?
Confirmed that the behavior is different in locally built vs MS version of VS Code.
If you have extension like this (derived from yo template), time on OSS vs time on MS version is different and consistent with what we have above:
import * as vscode from 'vscode';
import * as cp from 'child_process';
export function activate(context: vscode.ExtensionContext) {
console.log('Congratulations, your extension "test-it" is now active!');
let disposable = vscode.commands.registerCommand('test-it.helloWorld', async () => {
const folder = vscode.workspace.workspaceFolders![0];
const path = folder.uri.fsPath;
const start = Date.now();
cp.spawnSync('git', ['status']);
console.log('status took', Date.now() - start, 'ms');
});
}
// this method is called when your extension is deactivated
export function deactivate() {}
Current stable is based on Electron 13 which uses the patch attached in electron/electron#26143 (comment) . It is not very different from the libuv PR, just adapted to Electron 13 branch
Robo (@deepak1556) One more question if you don't mind. How do you build it? I assume you have some hidden repo, but electron has only cricle ci scripts. Do you have any other scripts to run it on github or azure?
Activity
solomatov commentedon Sep 8, 2021
Confirmed that the behavior is different in locally built vs MS version of VS Code.
If you have extension like this (derived from yo template), time on OSS vs time on MS version is different and consistent with what we have above:
deepak1556 commentedon Sep 8, 2021
You can try newer version of patch from libuv/libuv#3257 and build electron.
Unfortunately it is not quite easy to do it and not worth the effort for short-term.
solomatov commentedon Sep 8, 2021
Robo (@deepak1556) Ok. Will do it. Thanks for your help!
solomatov commentedon Sep 9, 2021
Robo (@deepak1556) BTW, which patch do you use in the latest vscode? (may be there're other patches as well)
deepak1556 commentedon Sep 9, 2021
Current stable is based on Electron 13 which uses the patch attached in electron/electron#26143 (comment) . It is not very different from the libuv PR, just adapted to Electron 13 branch
solomatov commentedon Sep 9, 2021
Robo (@deepak1556) Thanks, I will!
solomatov commentedon Sep 9, 2021
Robo (@deepak1556) One more question if you don't mind. How do you build it? I assume you have some hidden repo, but electron has only cricle ci scripts. Do you have any other scripts to run it on github or azure?
Also, I assume that you plug your custom build here: https://github.com/microsoft/vscode/blob/main/build/lib/electron.ts#L204 Is there an easy way to plug a locally built electron in there?
deepak1556 commentedon Sep 13, 2021
Yes our custom build uses Azure pipelines. The scripts are not generic enough to share for external usage.
You can provide a new repo value for repo via
product.jsonwhich contains binaries published in the format like https://github.com/electron/electron/releases/tag/v14.0.0