18x Faster IntelliSense for Unreal Engine Projects in Visual Studio 2022
With Visual Studio, we want to build the best tools to empower game developers. We joined forces with Epic Games to bring faster semantic highlighting and IntelliSense ready to Visual Studio 2022 for Unreal Engine developers. In this blog post, we will detail how we worked with the Unreal Engine team to significantly speed up the time it takes IntelliSense to start when a new file is opened in the editor by an order of 18x.
“We’ve always struggled with Intellisense performance in the Unreal Engine solution, but these changes are a night-and-day improvement. Faster feedback and less waiting help devs stay focused on making amazing games.” – Ben Marsh, Lead Programmer at Epic Games
The changes are available for Unreal Engine 4.27.1 projects using the latest Visual Studio 2022 Preview. The changes will be available for Unreal Engine 5 at a later date.
We tested using an Unreal Engine 4.27.1 sample project on a desktop with Intel Core i7-9700 @ 3Ghz, 64GB RAM, and an SSD. The tests took place on Visual Studio 2019 16.11.5 and Visual Studio 2022 Preview 6. The results were averaged over 4 runs.
When opening a file on Visual Studio 2019, it took 11.0 seconds for IntelliSense to be ready and semantic code colorization to show up. Opening a different file took the same amount of time to get to the same state. Closing and reopening the same file took 1.0 seconds for the ready state.
In comparison, Visual Studio 2022 took 7.2 seconds for the first file to be ready and 0.4 seconds for any subsequent files.
Prior to the change, each translation unit, the C++ and header files in your project, started from scratch with no state reuse between them. Reopening the same file took 1 second; however, because PCHs were not shared between files, opening any file for the first time took the same amount of time for semantic highlighting to show up and IntelliSense to be ready.
In Unreal Engine 4.27.1 projects using Visual Studio 2022, the generated project files are updated to configure IntelliSense to share compilation state across translation units. As a result, the semantic code colorization and IntelliSense completion will be available drastically quicker (0.4 seconds) when switching files in Visual Studio.
In addition, C++ IntelliSense improvements in VS2022 were able to bring down ready time by a factor of 1.5x from 11 seconds to 7.4 seconds. This change will benefit all C++ developers using IntelliSense, not only Unreal Engine developers.
Applying The Change to Your Project
Currently, you will need to manually make an update in the Unreal Engine Editor to apply the changes.
- Click Edit -> Editor Preferences -> Source Code
- Change Source Code Editor to “Visual Studio 2022”
- Click File -> Refresh Visual Studio 2022 Project
- Click File -> Open Visual Studio 2022 to open the project in Visual Studio
If you use GenerateProjectFiles.bat when working with Unreal Engine source code, use “GenerateProjectFiles.bat -2022” to generate project files with changes.
We received feedback about various ways of making the game developer experiences even better in Visual Studio. Throughout the Visual Studio 2022 development cycle, we will continue to make improvements like the one detailed in this blogpost.
How will these productivity enhancements impact you as a game developer? What other enhancements do you wish to see in Visual Studio? Talk to us in the comments below, on Twitter (@VisualC), or via email at firstname.lastname@example.org
Upgrade to Visual Studio 2022
Visual Studio 2022 is now available!