18x Faster IntelliSense for Unreal Engine Projects in Visual Studio 2022

David Li

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.

Image UnrealPCHOld30s

Image UnrealPCHNew15s

Testing Methodology

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.

Results

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.

Image UnrealPCH

Analysis

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.

  1. Click Edit -> Editor Preferences -> Source Code
  2. Change Source Code Editor to “Visual Studio 2022”
  3. Click File -> Refresh Visual Studio 2022 Project
  4. 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.

Feedback Wanted!

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 visualcpp@microsoft.com

Upgrade to Visual Studio 2022

Visual Studio 2022 is now available! 

 

15 comments

Discussion is closed. Login to edit/delete existing comments.

  • Damir Halilović 0

    This is a very welcome change. Is there a possibility that we will see more UE4 specific improvements such as macro indenting, proper auto-generated folder placements for new files (they currently default into the Intermediate directory), or macro auto-suggestins?

    • David LiMicrosoft employee 0

      Those are great suggestions! We will look into the possibility of those UE4 specific improvements

  • Jaroslav Smid 0

    No idea where to ask this, but.. any idea if it will be possible to purchase perpetual license of Visual Studio 2022 Professional, as it was possible with 2019? I just can’t find any information about this, and it seems that the very same license was carefully hidden from MS website too and it is very hard to find. It was around $499 license. Will it still be available, or is there any information about thiscontinuing this type license? I am specificaly not interested in any kind of subscription license and I cannot use community license. Thank you for any information or links.

    • David LiMicrosoft employee 0

      Hi Jaroslav,

      At the moment, we do not have a perpetual license for VS2022.

  • Todd Seiler 0

    People use VAX because they can use an old visual studio (games as a service anyone?) and get fast intellisense-like functionality.
    This optimization buys people nothing unless they are starting a new project, with a new version of the engine, with new visual studio tools (hopefully the console SDKs support visual studio 2022 soon [they won’t]), but somehow too cheap/poor to afford VAX or similar extensions. Which is a ridiculous scenario that never happens.

    • David LiMicrosoft employee 0

      Hey Todd,

      We have VS2022 support for quite a few SDKs. Xbox is now supported as of the October GDK release. The Sony SDK supports VS2022. Is there a platform/SDK you are working on that does not work for VS2022 yet?

  • gast128 0

    Intellisense is changed almost every Visual Studio version. There used to be notorious versions where it could hang Visual Studio or that a parse would take half an hour (VS2008) and luckily it is much better these days. When it works it is very handy but it still may fail from time to time. For example ‘go to definition’ may take ages and may not come up with an answer from time to time even when you are in the header file of a corresponding cpp.

    There used to be an alternative external add-in ‘Workspace Whiz’ which was a very fast tool and it almost never failed. Unfortunately that doesn’t work anymore so I have to use Intellisense for looking up definitions.

    • Tamás Körözsi 0

      Have you tried Visual Assist? It’s an extension which has a GoTo functionality which is very fast. It already has x64 version for VS2022 support, which helps when you open very very large solutions, but also supports older Visual Studios.

    • David LiMicrosoft employee 0

      Hi there,

      We’ve been hearing a lot from the community about “GoTo”. We are currently evaluating, thanks for the feedback! Every additional feedback helps make the decision process easier for the team.

  • Zsolt Fülöp 0

    It’s a really nice performance upgrade (now it’s usable), BUT the auto completion provided for some unreal specific features is just non-existent in a variety of cases; like UPROPERTY or UFUNCTION options has no completion at all.

    • David LiMicrosoft employee 0

      Thanks for your feedback! We will look in to making Unreal Engine specific compatibility.

  • macro gu 0

    I use vs2022, its version is:

    Microsoft Visual Studio Community 2022
    Version 17.0.1
    VisualStudio.17.Release/17.0.1+31912.275
    Microsoft .NET Framework
    Version 4.8.04084
    
    Installed Version: Community
    
    Visual C++ 2022   00482-90000-00000-AA453
    Microsoft Visual C++ 2022
    

    when I compile the project under unreal engine 4.27.1 version, it show the compile log:

    1>  [20/103] PCH.GitSourceControl.cpp
    1>  Detected compiler newer than Visual Studio 2019, please update min version checking in WindowsPlatformCompilerSetup.h
    1>  [21/103] PCH.PTMTool.cpp
    1>  Detected compiler newer than Visual Studio 2019, please update min version checking in WindowsPlatformCompilerSetup.h
    1>  [22/103] Module.PTMTool.gen.cpp

    does this a warnning for the compiler is newer than visual studio 2019, because I just want to use vs2022, I do not want my project has any relationship with vs2019, How I can fix that, thanks.

    • David LiMicrosoft employee 0

      Hi Marco,

      There’s a preprocessor check at the top of Engine\Source\Runtime\Core\Public\Windows\WindowsPlatformCompilerSetup.h that is checking _MSC_VER, changing it to this would get rid of the warning:

      //
      // Future-proofing the min version check so we keep bumping it whenever we upgrade.
      //
      #if defined(_MSC_VER) && _MSC_VER > 1939
      #pragma message("Detected compiler newer than Visual Studio 2022, please update min version checking in WindowsPlatformCompilerSetup.h")
      #endif
  • macro gu 0

    when I use VS2022 to compile c++ project, it always shows:

    >Using Visual Studio 2019 14.30.30705 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705) and Windows 10.0.22000.0 SDK (C:\Program Files (x86)\Windows Kits\10).

    it shows Using Visual Studio 2019 14.30.30705 toolchain, so vs2022 still need vs2019? because I just want to use vs2022

  • Nicholas Laberge 0

    Hello,

    It doesn’t seem like Unreal Engine 4.27.1 nor Unreal Engine 5 Early Access can find Visual Studio 2022 in the drop down list in the Source Code menu within the editor. Is there an alternative method into getting Unreal Engine to recognize VS 2022?

Feedback usabilla icon