Jul 14, 2011

Application suddenly becomes slow

I experienced this while I was developing my application in Visual Studio.
It happened for no apparent reason (I didn't remember to make any signifficant changes in this application).

It was really frustrating. The thought that I may need to rething the whole application was a nightmare.

I was in panic and started to think what the problem for this sudden degradation might be.

And guess what?
It appeared to be because of a conditional breakpoint I have set in one of the complex modules.

The program flow was passing through this line of code hundreds of thousand of times so Visual Studio was kind of slow determining if the condition for the breakpoint is true or not.

So remember this for the rest of your life:
"Conditional breakpoints may slow your application considerably, before doing stupid things in case of sudden performance degradation - be sure to remove your breakpoints first (Debug Menu => Disable All Break Points), then check the performance again.".

2 comments:

cypressx said...

Useful tip, man! :)

Павелъ Дончевъ said...

Yep.
Learn it the hard way :).