Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio extreme lag spikes while debugging

When Im debugging my app in VS2012 and it crashes, the input (mouse and keyboard) starts to lag extremely, the fps drops to about 0.3 or less and I can't even move my mouse without waiting 3 seconds... The only solution is to do Shift-F5 which will end the debugging, and everythng is fine then again.

Whats more interesting, the only lagging thing is the input, the whole background works perfectly fine, text caret is blinking at normal rate and tooltips are nicely animated when mouse gets over a button.

Im compiling the project with allegro 4.2 (I have to use it, it would take too long to explain why).

I have no extensions, a pretty fast pc which should be able to handle debugging...

Im interested in any solution, it may be dirty/hackish... I can of course provide more information if needed.

Thanks for any help.

EDIT: Reading through forums I found some information about the "Auto" window or something like that (don't remember exactly and can't find it anymore), which is doing some "background tasks" and that causes lags... Do you think running it on separate core would fix that?

like image 307
noisy cat Avatar asked Sep 21 '26 11:09

noisy cat


1 Answers

A tale of multi-second stalls when hitting a breakpoint, related to the raw input API: http://the-witness.net/news/2012/12/finding-and-fixing-a-five-second-stall/ (archived)

It's a very long time since I last saw this sort of thing myself, but I seem to remember that the culprit in my case was DirectInput. (This makes some sense, given the tale above, as DirectInput has long been a wrapper over the raw input API.) And I think the solution was to use the emulated keyboard and mouse devices rather than the default ones, which you do this by passing in one of the emulated device GUIDs to IDirectInput8_CreateDevice. Discussed briefly here: http://msdn.microsoft.com/en-us/library/windows/desktop/ee416845%28v=vs.85%29.aspx

(I don't remember whether cooperative and exclusivity levels made a difference - it might be worth trying changing these too.)

like image 106
Tom Seddon Avatar answered Sep 24 '26 03:09

Tom Seddon