Announcement

Collapse
No announcement yet.

For those who suffer from Visual Studio IntelliSense slowness

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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:
    Originally posted by sparkie View Post
    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: " <NMakeForcedUsingAssemblies>$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>" + ProjectFileGenerator.NewLine +
    Once found, add this line below it: " <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.
    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 or this 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 the troubleshooting blog post by Andy Rich
    As a quick and dirty workaround for PCH, you can often just specify “/Yu” with no parameters, and the IntelliSense engine will create a default PCH for you. But in the long run, you will have better overall performance and less issues if you mirror your build system’s PCH settings here.
    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.
    Last edited by mycC; 12-11-2015, 12:05 AM. Reason: grammar and some additional note

    #2
    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.

    Comment


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

      Comment


        #4
        Works like a charm, thanks mycC!
        • Follow me on twitter
        • Visit our website traverse.world
        • Checkout our game's forum thread

        Comment


          #5
          Originally posted by Rob-bb View Post
          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.
          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)

          Originally posted by akiro64 View Post
          I've already got a huge improvement in speed when making simple changes to code. Thanks a ton for sharing, mycC!
          wow! do you mind sharing the changes you made? i would love to further improve the speed as well.

          Originally posted by xulture View Post
          Works like a charm, thanks mycC!
          I am glad it helped

          Comment


            #6
            mycC, I love you

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

            Comment


              #7
              Originally posted by mycC View Post
              wow! do you mind sharing the changes you made? i would love to further improve the speed as well.
              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

              Comment


                #8
                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?
                Youtube - UnrealEverything

                Games:
                [Android] World of Bricks Released!

                [TUTORIAL] Edge Detection Post Process Effect using World Normals

                2B || !(2B)

                Comment


                  #9
                  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++.

                  VS C# Intellisence is snappy, regardless of project size, and practically writes code for you ...

                  Comment


                    #10
                    Originally posted by mycC View Post
                    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)
                    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.

                    Comment


                      #11
                      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: " <NMakeForcedUsingAssemblies>$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>" + ProjectFileGenerator.NewLine +
                      Once found, add this line below it: " <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.

                      Comment


                        #12
                        Originally posted by sparkie View Post
                        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: " <NMakeForcedUsingAssemblies>$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>" + ProjectFileGenerator.NewLine +
                        Once found, add this line below it: " <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!

                        Comment


                          #13
                          Thought on OP in "why this does work" it is explained, if you want to see the flag explanation https://msdn.microsoft.com/en-us/library/z0atkd6c.aspx

                          Comment


                            #14
                            Originally posted by akiro64 View Post
                            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
                            lol, it's ok
                            Originally posted by sparkie View Post
                            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: " <NMakeForcedUsingAssemblies>$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>" + ProjectFileGenerator.NewLine +
                            Once found, add this line below it: " <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.
                            Cool! this is awesome! but i think this only works if you build the engine from source right?
                            Last edited by mycC; 12-10-2015, 11:59 PM. Reason: additional question

                            Comment


                              #15
                              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).

                              Comment

                              Working...
                              X