For those who suffer from Visual Studio IntelliSense slowness

**tl;dr **
go to Project>>“project_name” Properties>>NMake on the left sidebar>> put /Yu in the Additional Options under IntelliSense

Confirm then Visual Studio will start generating pre-compiled header file specifically for intellisense, and the file will be put under ipch folder within your project folder.
This will probably reduce the intellisense auto-complete response time (in a newly generated project) from 10+ seconds to about 1 second if you are modifying outside of any function, or 50ms if you are within a function.

Update:

Thank you, sparkie.
Note: the file can only be found if you build engine from source, and it’s in /Engine/Source/Programs/UnrealBuildTool/System/ folder
**
Why would this work?**
because every time you modify the source file,
intellisense will try to find the references made in your source by searching through all the paths provided.
This wouldn’t be a problem if you don’t have a lot of paths, but UE projects are HUGE (take a look at the Include Search Path above Additional Options),
it takes a lot of time to go through all of them.
However, since the library codes don’t change at all, so there is no reason to search through them every time you press ‘f’ in the text editor.
We can just make a pre-compiled header file with all the stable codes and let intellisense to use it as the reference.
by putting /Yu in the Additional Options, we tell intellisense to use the pre-compiled header file.
(and if there isn’t one, intellisense is smart enough to generate one itself)
If you want to know more orthis still doesn’t fix your problem, please see… yeah, you just read pass the links.
if your auto-complete member list simply doesn’t show at all,
you might accidentally turn it off.
Take a look at this post from Epic’s documentation about setting up Visual Studio
Here comes the long version, AKA my rant and the journey breaking through all the “solutions” found on teh interweb
Hi guys, I have been trying out UE4 for a month and decided to learn C++ about a week ago,
but my progress was hugely impeded by the slowness of Intellisense (10+ seconds for auto-complete’s memberlist to show up)
So I decided to fix the problem once and for all.

five days later…

“solutions” tried:

  1. delete sdf database file or open new project- doesn’t work

  2. move the Unreal Engine folder to ssd drive- doesn’t work
    and i even downloaded and use process monitor to check the parsing speed
    ssd and hdd took almost the same amount of time. I still don’t know why, but i observed that VCPkgsrv.exe (intellisense’s work item) spent most time on opening files, not on reading them,
    so I guess this may be the reason?

3.reinstall unreal engine- doesn’t work

4.reinstall visual studio- doesn’t work

5.compile unreal engine from source- doesn’t work
and it took so god **** long.

6.update Windows- doesn’t work

7.reinstall windows AND unreal engine AND visual studio- doesn’t work

8.use Qtcreator instead- it works! sort of.
as suggested by wiki, implemented with AlphaN’s project generation tool.
It actually reduced the auto-complete time to almost instantly.
However, a lot of features I am used to couldn’t be found (like multi-edit and re-mapping cursor movement or delete keys)
but this will actually be a better solution if you like Qtcreator more.
Edit: forgot to mention, currently Qtcreator only works with VS2013. Just a heads up to save you from the WAHHHH!? experience I had.

9.use other text editors- i was too noob to make it work
tried to modify sublime text 3 and Atom to mimic intellisense’s functionality,
and some people suggested using Clang or Ctags could work,
but I was simply not skilled enough to do it.

10.Y U NO USE VAX!!!??
Documentation and information about Intellisense is scarce at best; most people from UE forum and stack overflow seemed to lost all the hope on intellisense,
and simply suggest newcomers to use Visual Assist X. I didn’t try it.
At first it was the money; two days in, it was the sunk-cost.
And now, here I am, spent enough time to buy myself more than one licenses if I was doing my real job.
So I decided to write this post to prevent other unfortunate souls like myself to waste more time on this thing.
If the /Yu still doesn’t fix your problem, or 1 second wait is still too long for you, I guess you really should try VAX,
I only heard(read) good things about it.

finally, from thetroubleshooting blog post by Andy Rich

Even though /Yu really reduce the response time to an acceptable range, I find that even if i use pch, intellisense will still search through all the engine codes’ include paths once when i modify the actor codes.
I have been tinkering with the /Yc /Yu settings all day, but I still can’t change this behavior, is this suppose to happen?
Also, I don’t really understand why it only takes 50ms to generate the memberlist within a function, but takes more than 1300ms to generate it outside.
Are there ways to further reduce the time?

FINAL finally,
I am new to UE, C++, and Visual Studio, so a lot of the stuff I write up there are just from documents I read and my own interpretations; there might be errors, so please correct me if you find one.
Thank you.

4 Likes

ha, I just spent the weekend solving the same problem and wound up with the same solutions, except at first I spent hours uninstalling and reinstalling vs12015, got caught up in an installer bug and wasted more hours trying to find a solution, and then found out about the /Yu settings.

Why is this not on by default? (looking at Microsoft here, not Epic) It just seems like a stupid thing to have to opt-into.

I’ve already got a huge improvement in speed when making simple changes to code. Thanks a ton for sharing, mycC!

Works like a charm, thanks mycC!

Totally agree, but I think we can also make some change to the UE source, so it will fill out the additional options by default (since all the other fields were filled out by the engine)

wow! do you mind sharing the changes you made? i would love to further improve the speed as well.

I am glad it helped :smiley:

mycC, I love you :slight_smile:

Seriously, I’ve been loosing my nerves with intellisense slowness for weeks now. This seems to be thesolution.

Oh, I meant that my Intellisense speed was improved when I was making simple code edits. I didn’t mean that I did anything extra on top of what you recommended. Sorry to mislead :frowning:

Thank you very much. This actually helps a lot.

Unfortunately you have to repeat this step every time project files are updated/regenerated. Or is there a way around that I am unfamiliar with?

Hmm gonna try this out.

After doing a lot of C# coding for last 5+ years, I don’t understand why the VS Intellisense is so bad out of the box for C++. :frowning:

VS C# Intellisence is snappy, regardless of project size, and practically writes code for you … :stuck_out_tongue: :eek:

I guess it should be possible. I am not sure how the system generates the files but isn’t it a .bat file or something like that? On Linux it is a shell script so I assume a .bat on windows.

There is an easy way to automatically make the generated projects contain the /Yu flag for IntelliSense.

Inside the file VCProject.cs you can look for the following line: [FONT=Courier New]" <NMakeForcedUsingAssemblies>$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>" + ProjectFileGenerator.NewLine +
Once found, add this line below it: [FONT=Courier New]" <AdditionalOptions>/Yu</AdditionalOptions>" + ProjectFileGenerator.NewLine +

Now build the UnrealBuildTool and the next time you generate your project files, it will contain the flag for all the C++ projects inside the solution.

Awesome! Thank you all in this thread!

Thought on OP in “why this does work” it is explained, if you want to see the flag explanation /Yu (Use precompiled header file) | Microsoft Docs

lol, it’s ok :smiley:

Cool! this is awesome! but i think this only works if you build the engine from source right?

It works best when you are not editing header files??

Anyway, a little off topic, still related to visual studio community 2015… I want to shift+enter put semicolon at end of line (wherever Im on the line) and put the cursor on the new line, anyone? (I already installed propowertools vs 2015 but that didnt work xD).

Sounds like a macro (END ; ENTER)? Maybe this https://visualstudiogallery.msdn.microsoft.com/8e2103b6-87cf-4fef-9410-a580c434b602

The target to build the UnrealBuildTool is missing from the solution when using the launcher. So yes, you need the version from GitHub if you want to make modifications to that project.

any way to make the build error log less random?

edit:
for example, log says “everything is an error”
half an hour wasted says “variable declared twice”

any way to force the compiler to see things like that?
VS2015

half an hour later you could have changed something that caused to show the variable declared twice.

Those errors are reported by C++ compiler, in any case if you are with vs 2015 community that will mean more on the side of MS.

Mmmm, I will suguest use source control with git (or other) and if it is code change, you can look at the diff, stash it, or revert it all.

i have source control thanks.
would be nice if the compiler caught the actual error though instead of saying everything is an error.
possibly i shouldnt code so much in 1 go while im tired, it just takes so long to compile though, oh well lesson learned. need to be patient and compile often.