views:

133

answers:

3

I have a solution with 21 C++ projects and 1 VB.NET project. The IDE responds very slowly when I simply move the carret in a file or try to open the menu. The process seems to take 50% of CPU for each movement. It only happens with this solution and only on my machine.

The solution has total of 2380 source and header files, of which 1280 are header files.

I tried to remove all connection to the source control (Perforce) but it didn't help. Also, I have Visual Assist installed but even after removing it (uninstall), the same behavior continued.

Any idea?

+3  A: 

Deactivate intellisense.

http://blogs.msdn.com/b/saraford/archive/2007/12/03/did-you-know-how-to-turn-off-intellisense-by-default.aspx

Intellisense parses the whole project and slows down the IDE drastically. If you use Visual Assist then you won't really need it. Visual Assist is less resource hungry and scans in the background, intellisense steals too many resources during its parsing.

Could this apply in your case? http://coolthingoftheday.blogspot.com/2008/03/visual-basic-2008-hotfix-to-fix-slow.html

jdehaan
And also try to remove the `.ncb` file.
goodrone
I tried your advice to deactivate intellisense but it didn't help.Note that the link in your answer was not relevant (it's for FoxPro and it says to look for Tools->Intellisense Manager menu but I don't have it.Instead I used macros as suggested by http://blogs.msdn.com/b/vcblog/archive/2007/11/19/controlling-intellisense-through-macros.aspxAlso, I tried removing .ncb file and that didn't help either.
VioletRose
@VioletRose: Are you saying that you couldn't successfully deactivate intellisense, or that you deactivated it, and it didn't improve performance?
jalf
I'm not sure. I used these macros to deactivate Intellisense. The status macro said it is off. According to documentation for these macros there shouldn't be any parsing or querying to the ncb file. But how can I tell if it's really off?
VioletRose
I did notice that there are no intellisense suggestions when I type and it's Off.
VioletRose
In the status bar even with disabled or let's better say reduced Intellisense some text stating the project is being parsed is there but parsing is much much faster and suggestions are off. Sorry for the bad link, I verified the settings I have and the fixed link in the answer is what I use.
jdehaan
A: 

Note that disabling Intellisense may also break stuff like the Class Wizard (at least I'm pretty sure it does in VS2005). As already suggested it's a good idea to get rid of all the temporary files like .ncb regularly, because they can get huge and will slow down the IDE. Also, if you're using Visual Assist, try rebuilding the database, disabling it or installing a different version.

humbagumba
A: 

I have a few solutions with over 100 projects, so I know exactly how you feel. Solutions containing some managed projects are especially bad. Disabling Intellisense helps a lot. I've never seen such problems from Visual Assist (or other similar refactoring tools), and that fills in a lot of the missing functionality from losing Intellisense.

I've also encountered some projects that had code that would cause the Intellisense thread to endlessly loop and never finish parsing the code. Most of those times we were never able to pin down the exact bit of code that caused the problem. Certain heavy use of templates and nested macros were often high on the suspicion list.

The only good way to be sure that Intellisense is disabled is to create a directory with the same name as the ncb file. Go to your solution directory, delete the ncb, and create a directory named your_solution_name.ncb. Because it can't recreate the ncb file, you'll get an error box to click through every time you open the solution, but that's a small price to pay.

Simply deleting the ncb will mean that VS will just create it again. The methods that I've seen from inside the VS options will turn off some of the features but will not prevent it from trying to parse all your code.

Alan
I tried to remove the ncb file and create a directory instead. Unfortunately, it didn't help.Seems the problem is not in Intellisense.
VioletRose