Debugging in VS 2012 is PAINFULLY slow

Class library usage, coding and language questions.
carsonw
Posts: 178
Joined: Tue Nov 08, 2011 10:01 pm

Debugging in VS 2012 is PAINFULLY slow

Post by carsonw » Wed Oct 09, 2013 6:11 pm

Has anyone else experienced extreme slowness when debugging in VS2012? Basically stepping over a single line of code takes 10-15 seconds (or more!). I don't have this problem in ranorex studio though.

Is anyone aware of any settings I should be changing in VS2012 to make the debugging more manageable? In the debug settings I have "just my code" selected.

Thanks!

carsonw
Posts: 178
Joined: Tue Nov 08, 2011 10:01 pm

Re: Debugging in VS 2012 is PAINFULLY slow

Post by carsonw » Thu Oct 10, 2013 6:39 pm

Here is what I've tried so far:

* Disabled JIT debugging
* Checked Enabled Just My Code
* Cached Symbols from Microsoft Symbols Server
* Set all projects to x86 (rather than AnyCPU)
* Delete all files from //users/appdata/.../temp
* Delete all breakpoints

Essentially these are all the solutions from Google. Has anyone else observed problems here (and overcome them?). Is anyone successfully debugging (preferably large/complex) solutions with 2012?

I tested VS2010 as well with the same result. I also tried 2012 on a different machine, also with a same result.
Testing another solution that is not related to Ranorex does not have any problems debugging.

At this point, debugging is not possible for Ranorex in VS2012 for me... I'm hoping someone may have encountered something similar and sovled it, or there are some other insights (I know there have been similar issues with the Ranorex Studio in the passed that were solved, albeit through patches).

carsonw
Posts: 178
Joined: Tue Nov 08, 2011 10:01 pm

Re: Debugging in VS 2012 is PAINFULLY slow

Post by carsonw » Fri Oct 11, 2013 1:56 am

I have also noticed this when trying to evaluate properties: "this function evaluation requires all threads to run"

though I've not seen that in the Ranorex Studio (and thus I cannot see the value of the property unless I click a little unblock button which can take a couple of seconds to resolve). Also, I got a cross threading violation when the test was just ending... presumably when it was writing the report (not seen that happen in the studio either).

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Debugging in VS 2012 is PAINFULLY slow

Post by Support Team » Mon Oct 14, 2013 4:00 pm

Hello,

Thank you for reporting this issue.
I could reproduce it with a simple solution.

I added this issue into our bug-tracking system in order to provide a fix as soon as possible.
I will keep you informed about any updates on this.
Thank you for your patience and understanding.

Regards,
Markus (T)

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Debugging in VS 2012 is PAINFULLY slow

Post by Support Team » Tue Oct 15, 2013 3:19 pm

Hello,

Could you please try to disable the 'property evaluation' for Debugging in Visual Studio?
Please let me know if you experience any difference.

Thank you in advance.

Regards,
Markus (T)
You do not have the required permissions to view the files attached to this post.

CookieMonster
Certified Professional
Certified Professional
Posts: 74
Joined: Mon Aug 14, 2006 7:17 pm
Location: CH

Re: Debugging in VS 2012 is PAINFULLY slow

Post by CookieMonster » Tue Oct 15, 2013 5:20 pm

Hi,

I also had this problem, with the 10 seconds, when I stepped over a single line during debugging. Do you may have this line implemented ?

Code: Select all

    Keyboard.AbortKey = System.Windows.Forms.Keys.Pause;  
If yes, delete this line, then you can easily debug your code, or put the into a (directive)

Code: Select all

#if TEST
   Keyboard.AbortKey = System.Windows.Forms.Keys.Pause;  
#end if 
Cheers
Dan

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Debugging in VS 2012 is PAINFULLY slow

Post by Support Team » Thu Oct 17, 2013 3:30 pm

Hello Dan,

Thank you for providing this nice workaround for debugging in Visual Studio.
All I can say at the moment is that we are working on a solution to fix this issue as soon as possible.

Regards,
Markus (T)

carsonw
Posts: 178
Joined: Tue Nov 08, 2011 10:01 pm

Re: Debugging in VS 2012 is PAINFULLY slow

Post by carsonw » Fri Oct 18, 2013 12:52 am

Thanks for the responses on this! I'll try both solutions and report back...:)

carsonw
Posts: 178
Joined: Tue Nov 08, 2011 10:01 pm

Re: Debugging in VS 2012 is PAINFULLY slow

Post by carsonw » Fri Oct 18, 2013 7:43 pm

Commenting out the Keyboard.Abortkey code seemed to do the trick!

De-selecting Enable property evaluation and other implicit function calls did not though :(

carsonw
Posts: 178
Joined: Tue Nov 08, 2011 10:01 pm

Re: Debugging in VS 2012 is PAINFULLY slow

Post by carsonw » Thu Jan 16, 2014 12:46 am

Hi guys - we're in January now so I'm just following up on this. Rather than just being very slow, it now completely locks my entire computer for a moment at each step.

The commenting of Keyboard.AbortKey = System.Windows.Forms.Keys.Pause still works, but the problem should really be fixed.

User avatar
BernhardS
Ranorex Guru
Ranorex Guru
Posts: 32
Joined: Tue Dec 17, 2013 6:35 pm

Re: Debugging in VS 2012 is PAINFULLY slow

Post by BernhardS » Fri Jan 17, 2014 4:09 pm

Hello carsonw,

We are working on that issue at the moment, but unfortunately I cannot give you a time frame when it will be integrated in Ranorex because we don't want undesirable side-effects.

Regards,
Bernhard

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Debugging in VS 2012 is PAINFULLY slow

Post by Support Team » Fri Jan 17, 2014 11:27 pm

I'd like to add some information that could maybe help you work around the problem.

The problem, that mouse/keyboard input is blocked when the test process is halted by the debugger, is caused by the so-called mouse/keyboard low level hooks used by Ranorex to record inputs. Every input is routed to the Ranorex test process, recorded, and only then processed by the system, e.g. resulting in a mouse move.

When the Ranorex test process is halted in a break point, it cannot process the input events any more and no more input reaches the Windows system. That problem is not specific to VS 2012, but to all debuggers halting Ranorex test processes using the AbortKey. Ranorex Studio disables those hooks just before halting the process, Visual Studio would need to do the same (but currently doesn't).

Fortunately, there is a timeout for blocked events called LowLevelHooksTimeout. When this timeout is reached, the input events will be processed by the system and the hooks are disabled. The Windows default is 300 milliseconds, but Visual Studio 2012 sets the LowLevelHooksTimeout to 5000 (no one knows why).

So the work around I suggest is searching for the LowLevelHooksTimeout in the registry on your machine and setting it to a lower value, e.g. 300 milliseconds. That way, mouse/keyboard input will only be blocked for 300ms once the process is halted by the debugger. When you set the timeout, you need to log off and on again so Windows uses the new value.

Hoping the work around helps you while we try to find a fix!

Regards,
Alex

carsonw
Posts: 178
Joined: Tue Nov 08, 2011 10:01 pm

Re: Debugging in VS 2012 is PAINFULLY slow

Post by carsonw » Thu Jan 30, 2014 7:38 pm

Hi Alex - that's really interesting thanks so much for the response. I've changed my settings so I'll let you know how it goes from there!

Carson.