vscode: VSCode 1.66 slow, laggy when re-focusing/switching back to editing from another window or program
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.66.0
- OS Version: Windows 7 SP1 x64
Steps to Reproduce:
- Open any JS file and then switch window/focus to another app (e.g. a browser)
- Switch/focus back to VSCode JS file and it takes about 2 seconds to be able to edit. It’s some kind of lag, it takes time until you can start editing again.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 27
- Comments: 53 (14 by maintainers)
Also this popup appears when I try to close VSCode, it stays on for 20-30 seconds. This has never occurred with 1.65.x or older versions.
@deepak1556 @isidorn I have good news - I have finally managed to solve this problem on Windows 7 x64.
The solution to get rid of the slowness and get back the snappiness and quick reaction when focusing back to VSCode from another program is to uninstall VSCode, restart the PC and completely remove the folder
C:\Users\[User]\AppData\Roaming\Code
, which in my case had 380 MB and several thousand files cached in it. The folder has grown so much over 2 years of daily VSCode use, with regular upgrading to newest version as soon as it was released. I’ve also removed the VSCode extensions folderC:\Users\[User]\.vscode
, I’m not sure whether that helped or not.After reinstalling VSCode I had to reconfigure everything from scratch and install all extensions, but the cache folder is now only 80 MB and contains 550 files. Working with VSCode is a breeze again…
*Credit goes to @icedterminal https://github.com/microsoft/vscode/issues/146737#issuecomment-1124494187 - thanks for the idea!
*Cross-referencing possibly related issues, perhaps it helps someone else not noticing this solution: https://github.com/microsoft/vscode/issues/123257 https://github.com/microsoft/vscode/issues/141735 https://github.com/microsoft/vscode/issues/147151 https://github.com/microsoft/vscode/issues/147188
Edit: Slow file open fixed as well - brilliant!
@deepak1556 Is there anything to be done about this other problem, which seems to be somewhat related to the lag issues? Namely, when closing VSCode, it takes about 20 seconds with this spinner waiting for something:
This is really getting frustratingly slow! Not only is it slow on re-focus to the main window, but it’s also very sluggish when opening a current working folder… first, it starts with showing the dreaded
Closing the window is taking a bit longer...
for a few seconds and then it takes 10-15 more seconds to actually open the folder.This software used to be quick and snappy and I’m not sure what exactly happened with the 1.66.x version - you cannot use it in production anymore. Is it not bothering anyone else?
@deepak1556 @bpasero I’ve just tested 1.67 and sorry to say, the lag and slowness when switching from Chrome to a VSCode tab is exactly the same as in 1.66+. Last version without this issue is 1.65.2.
Just checked 1.67 comes with Electron 17.4.1, but there are newer versions 17.4.2 and even 17.4.3… wonder if it could be updated?
Downgraded to VSCode 1.65.2 (Electron 13.5.2 and Chromium 91) - it’s fast and responsive.
@icedterminal please open a separate issue for the slow startup issue and provide the numbers following the steps at https://github.com/microsoft/vscode/wiki/Performance-Issues#read-the-startup-timers. This issue was originally opened for unresponsiveness when focusing VSCode from another application which is different from the issue you are describing.
@lorand-horvath as mentioned in https://github.com/microsoft/vscode/issues/146737#issuecomment-1123622008 if you can repro the issue on newer windows then we can reopen the issue to further investigate it with ETW profiles. Windows 7 is not officially supported by Nodejs or Electron, so there could be other system calls added in newer versions that could cause the slowdown in your case, occlusion tracker was just one element to the cause to be tested.
How can I reopen this issue? If I create another one, it will be closed since it would be considered a duplicate. Catch 22?
@isidorn Thanks for this information, I’m definitely looking forward to testing a VSCode build based on Electron 18+
@deepak1556 I’ve just read your comment regarding the update to Electron 18 https://github.com/microsoft/vscode/pull/145527#issuecomment-1140742594 which I’ll keep an eye on.
Will do 😃 Thanks
@deepak1556 Thanks for the response
I realise that. Nuking
%AppData%\Code
which had ballooned to 300mib solved the slow down on launch with v1.66 and later, where as it didn’t matter with 1.65 and earlier.That said I still do experience the lag between application focusing (Alt + Tab) and taking longer to close. It’s just so random and inconsistent. I have installed 1.67 and will use a replay buffer to catch it when and if it happens.
I experience it on Ubuntu, through snap install.
@isidorn Ouch, it seems you’ve silently dropped support for Win 7 between February and April, at least according to web.archive
I will try Windows 10 maybe next year… but for now I’ll stay on Win 7 (I despise Win 10 with a passion) and revert to VSCode 1.65.2. Thanks for the heads up!
Started seeing this pop-up over the last few weeks time-to-time on a 2019 MBP. When I bumped up to the April 2022 release I started seeing it consistently when closing windows. And I’m also getting about a 10 second lag between code changes and visual feedback in TypeScript on the same machine running the April (and March, after I tried a rollback) releases.
Hi, I use vscode and 1.66.2 was impossible to use, like described here. I’ve downgraded to 1.65.2 like @lorand-horvath suggested, and it’s perfect. I am using snap, and at some point during an upgrade, it became like this. I thought it was on NFS, so I didn’t pay attention to it, but now I tested more and it was sluggish an any GUI action, basically unusable. I am a bit tight on time until next Tuesday to reinstall 1.66.2 and provide the logs for Performance issues, but I’ll try to come back then with them. For now, I’ll have to work with the version revert.
I’m seeing the same problem on 1.66 which is new. Another thing that happens is while Code is starting, it first looks like a Windows 7 titlebar (I am on Windows 10) until it finally loads, as well as the “closing the window is taking a bit longer”.
Neither of these issues happened before.