1. Disable unnecessary extensions
It is very common for some Visual Studio Code extensions to consume many system resources, which can slow down the editor's performance. To improve the performance of Visual Studio Code, it is advisable to disable extensions that are not frequently used or that are not essential for the workflow. To disable an extension, follow these steps:
- Open Visual Studio Code.
- Click on the "Extensions" tab in the left sidebar.
- Search for the extension you want to disable.
- Click the gear button next to the extension and select "Disable".
2. Update extensions and adjust the configuration
Visual Studio Code extensions are one of the reasons why it is so popular, but sometimes they can be the cause of the editor becoming slow. To improve the performance of Visual Studio Code, it is important to keep extensions updated and adjust the configuration as needed.
This is because some Visual Studio Code errors can be caused by outdated extensions or incorrect configurations.
To update Visual Studio Code extensions, follow these steps:
- Open Visual Studio Code.
- Click on the "Extensions" tab in the left sidebar.
- Click the update button at the top of the extensions list.
- (Optional) You can select Auto-Update so that extensions are automatically updated.
3. Clean the Visual Studio Code cache
Visual Studio Code caches files and data to improve editor performance. However, sometimes the cache can grow too large and slow down the performance of Visual Studio Code.
To clean the Visual Studio Code cache, follow these steps:
- Locate the VS Code user data folder: The location of this folder varies depending on your operating system:
- Windows:
%APPDATA%\Code\User\
or%USERPROFILE%\.vscode\
- macOS:
$HOME/Library/Application Support/Code/User/
- Linux:
$HOME/.config/Code/User/
- Windows:
- Within the "User" folder, search for and delete the following folders:
Cache
CachedData
Code Cache
(optional, this folder stores the cache of the VS Code main process)
4. Switch to a light theme
One of the lesser-known reasons why Visual Studio Code might have poor performance is the theme you are using.
Dark themes are popular among developers, but they can consume more system resources than light themes.
To change the Visual Studio Code theme, follow these steps:
- Open Visual Studio Code.
- Enter
Ctrl + Shift + P
to open the command palette orCmd + Shift + P
on macOS. - Type "Preferences: Color Theme" and select the desired option (preferably the ones that come by default).
5. Consider changing the SSD of your computer
If your computer has a mechanical hard drive (HDD) instead of a solid-state drive (SSD), consider upgrading to an SSD to improve the overall performance of Visual Studio Code and your system in general. SSDs are considerably faster than HDDs and can significantly accelerate the speed of file loading and overall system responsiveness.
Conclusion
By following these tips and tricks, you can significantly improve the performance of Visual Studio Code and optimize your development workflow. Remember to keep your extensions updated, clear the cache regularly, and consider upgrading to an SSD for a significant performance boost.