VS 2008 very slow after editing code.

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
I have VS and run in debug mode with some break points. When I find a problem, I fix it, but often times the program has already branched down the wrong path so while debugging I add a line(s) to change variable to what they need to be step run them then remove the lines. I also add if statements looking for specific cases I am trying to check.

The problem is that I make a change, press F11 to continue and wait for sometimes 5-10 minutes. It finally gets to the next line and changes the value so I comment out or delete the extra line(s) then hit F11 and again wait up to 5-10 minutes. This wait time is getting ridiculous as I spend most of the day waiting for basic changes.

I have no problems building a program or stepping though code if I did not change anything.

I also notice that when I start the application, the delay is usually very short and gets slower and slower. Restarting VS sometimes helps but it always get super slow within half an hour.
Also sometimes I can make change that will go though after 20 seconds while another will take 10 minutes. I don't understand why there are differences, especially of such magnitude.

If I stop debugging and start again it starts quickly, but then I loose the state I am trying to debug.

I have tried all the VS tweaks I found like removing extra files and projects with no effect. I have no issues starting or building a project or stepping through code only after I make a change while debugging.

Thanks
elkinm
 

brandonb

Diamond Member
Oct 17, 2006
3,731
2
0
Have you tried using the immediate window to make changes to variables? (Thats what it was designed for)
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
No I have not. I will do that in the future, however this is still only a small piece as I do need to change the code to fix it or to add or change an if statement which would still be slow.

Thanks
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Are you using any Addons for VS? Especially Resharper, as it will definitely hurt your performance if you're running an older machine.

How big is your codebase and what kind of machine are you using?
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
I am not using any add-ons, just regular VS 2008 SP1. The machine has a single X5355 quad core processor with 2 GB of ram on Windows XP. Not the fastest setup, but not to slow and I have not used over 500 mb of ram so far. When VS is slow, no core is maxed out so I am not sure what is going on. I never have any issues except for the previously mentioned cases.

I wonder, does VS do any re-checking of code once I make a change? If it remembers all the states and then goes through the entire code with all previous executions on every change, it would explain how it can slow down and get continually slower the longer it runs.
Otherwise, I don't see why I would not be able to continue as soon as VS recognizes that there are no build errors and it can continue. (if there is an error when I hit F11 or F5 is tells me right away)

EDIT: I forgot to mention, I am using VS 2008 Express, the free version not pro if that makes any difference.
 
Last edited:

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
Hello again. I have been using the immediate window to change values, and it has been working fine. The only issue is that the immediate window does not have any using statements in the main code so I have to enter the complete System path to the command. Is there any way to have the immediate window recognize the using statements from the main code?

Anyway, when I do make a code change it is still slow. The most common change I make is an if statement checking for some case I want to check. I break on the if statement, change the if statement parameters and set a break point inside the if statement. This is the simple change that I make very often and since the specific program state I am checking may be rare, this is where I need to be as fast as possible.
Any idea how I can speed this up? The if statements do nothing so could there be away to make VS almost ignore or not check them as much when they change?

Thanks again.

Oh, my code is about 8000 lines long, which I don't think is that much as building and rebuilding it takes seconds.
 
Last edited: