Was Visual Studio 2008 SP1 running errors or am I out of my mind?

I've searched my brains out trying to figure out what's going on with the most recent (non-beta) Visual Studio 2008 SP1:

My application built with OpenMP runs incredibly slow in the debugger with CPU usage reaching 100%. When run outside of the debugger, it is slow (for release builds).

My application, built using the Intel Thread Building Blocks, or my own implementation of the threads command, runs slower in the debugger than when run outside the debugger (for release builds).

When I move to another development machine that does not have SP1 installed, the situation is different. Running in or outside the debugger does not affect program performance. OpenMP speeds up my application, as does blocking a thread or threading custom code (written hastily out of annoyance to figure this out).

This is absolutely no changes made to the application, just run it inside or outside the debugger, SP1 and regular Visual Studio.

I didn't find anything about this on Google, so I stick my neck out and say something in the hopes that someone else will know that this is happening to them. Either that or I see things.

+2


source to share


1 answer


Yes. In some cases. We faced a similar situation with severe slowdown after upgrading to SP1. The reason for this was the exceptions. We had a datamodel that heavily used the pattern of trying to access keys in a dictionary, failing in it, and throwing an exception:

try {
  var a = dict[key];
} catch(KeyNotFoundException) {
  dict[key] = default;
  a = default;
}

      

This is just an example, but the reason was some kind of exception. For some reason VS, only in the debugger, is extremely slow. Note that this was before, but it was significantly worse with the new patch.



The solution is to just use a test. for the vocabulary example above, use .TryGet or in custom code check if your call will throw an exception before throwing it, if it is something that will be a lot (thus it is the "expected" thing instead of the "exceptional" thing) ...

More information: Exceptions and performance

+2


source







All Articles