Closed sjaffe314 closed 12 months ago
Did you solve the issue? I got the same problem here
@sjaffe314 can you confirm if you are using Mcafee AV ?
For me was that the issue related to Mcafee.
https://stackoverflow.com/questions/75931344/vs-code-is-not-responding-slow-startup-and-unresponsive
Is fine now
Thanks for giving this some thought @deepak1556. I do not have McAfee AV installed on my system. Just the standard Windows Security Antivirus (Defender). And I get the same ~30 second vscode startup time even after adding code.exe to the exclusion list or fully disabling Windows Security Virus Protection.
I still hope to find time to write a hello world Electron app, to see if the startup overhead is reproducible on that, but I haven't been able to set aside the time to do that yet. I've just fallen back to using the VS.NET IDE.
Thanks for the clarification, if you have chance to try the latest stable v1.78
, can you collect a trace following the steps in https://github.com/microsoft/vscode/issues/178962#issuecomment-1543836137
@deepak1556 - Per the instructions you referenced, I sent you an email with a WPR session that captured the slow startup of vscode v1.78.2 on my machine
Thanks @sjaffe314 , I will get back to you on this issue after looking at the trace.
Regarding McAfee, to confirm what others have seen, I noticed that vscode takes about 20-25 secs to load with McAfee "Real-Time Scanning" on and less tha 5 secs with it off.
@sjaffe314 can you please check if the issue has been addressed with latest insiders https://code.visualstudio.com/insiders which comes with an updated version of the runtime. Thanks!
@deepak1556 - I tried with the latest insider build (1.82.0-insider), and the slow startup occurs with that as well.
In case it helps, I'm emailing you a WPR trace of it. Let me know if there are additional metrics you would like.
So, to recap, I see the slow startup (~15 seconds before any visual artifact, a completely black window at 20 seconds, and the rendered vscode window at ~30 seconds) in both of my now parallel installations:
Version: 1.82.0-insider (user setup) Commit: ebd67244fb2da33ab078bb2baa96106fda29f336 Date: 2023-08-29T05:32:55.965Z Electron: 25.5.0 ElectronBuildId: 23084831 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.22621
And:
Version: 1.81.1 (user setup) Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794 Date: 2023-08-09T22:22:42.175Z Electron: 22.3.18 ElectronBuildId: 22689846 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.22621
@sjaffe314 thanks for the trace, I looked into it today and found that the process launch calls are delayed by a kernel driver routine from BadlionAnticheat.sys
that hooks into all process creation and deletion events. I am not sure what this routine does but it seems to originate from Badlion client, do you have it installed ? This reminded me of an old issue https://github.com/microsoft/vscode/issues/56644#issuecomment-613858693 maybe it is still relevant. Can you try uninstalling the client and see if it helps in improving the startup times of VS Code.
@deepak1556 - thanks so much for your additional investigation! I'm thrilled to say that VSCode now opens lightening fast for me!
I believe I had installed the Badlion Client several years ago to manage mods for Minecraft, and had subsequently uninstalled it awhile ago. I couldn't find any obvious references to it yesterday in my Windows "Add or Remove Programs" or C:\Program Files
, and the only file system artifact I could find was the C:\Windows\System32\drivers\BadlionAnticheat.sys
file your screen capture referenced, and a registry reference to badlion under a discord key. Anyway, I renamed the file to BadlionAnticheat.sys.disabled
, rebooted my OS, and now VSCode opens instantly!
Thanks again for your time. I realize a OS hook like this is outside the bounds of the VSCode system, but I deeply appreciate your effort to isolate that unexpected interaction. I'm still curious why VSCode seemed to be so disproportionately affected as compared to other applications I ran on my computer, but that's not something I'm going to lose any sleep over. I may also try to get familiar with reading those Windows Performance Recorder traces, so I can be more self sufficient on this kind of diagnosis in the future!
Thanks again!
Glad to know that the issue is resolved, thanks for your patience!
Vscode takes about 30 seconds to launch for me, but is perfectly fast after that.
My Windows 11 Dell laptop has all the latest Windows Updates, and all the latest Dell driver updates (graphics card, et al). I uninstalled vscode, deleted all the installation directories (so extensions didn't carry forward), and reinstalled vscode.
I have a fair bit of other software on my machine. But other things like Pycharm Community have a visual representation within 1 second of launch, and is fully functional within 3-5 seconds of launch. But vscode takes about 10 seconds before a faint outline of the vscode window appear, another 5-10 seconds before that faint outline fills entirely with black, and another 5-10 seconds until I typically get a "The window is not responding" dialog and vscode content starts to render under that. I seem to be able to reliably click "Close" on that dialog, which leaves vscode running after about a 30 second startup lag. Vscode seems perfectly responsive after that. And, again, pretty much every other application I start on my computer feels responsive right from the point of launch.
Turning off Antivirus (Windows Security > real-time protection) didn't help. And I don't have the Nahimic audio driver that people attributed similar performance problems to (rooted in Electron and discussed under #22087).
Below are the startup profiling files:
And here is the result of my "Startup Performance" stats:
System Info
Code: 1.75.1 (441438abd1ac652551dbe4d408dfcec8a499b8bf)
OS: win32(10.0.22621)
CPUs: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz(8 x 1992)
Memory(System): 15.84 GB(8.44GB free)
Memory(Process): 177.07 MB working set(136.25MB private, 0.25MB shared)
VM(likelihood): 0%
Initial Startup: true
Has 0 other windows
Screen Reader Active: false
Empty Workspace: true
Performance Marks
Raw Perf Marks: main
Raw Perf Marks: renderer
Node Cached Data Stats
cached data used
cached data missed
cached data rejected
cached data created (lazy, might need refreshes)