Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WaitForSingleObject while debugging (General slowness during debugging)

I must say I know a lot of things about threads, but theres something that is driving me crazy.

I use to wait for a thread using the Windows API function WaitForSingleObject and it works fine. But, when i am debugging my code, it seems that WaitForSingleObject is very, very, very slow (it hangs a lot). But when I am just running my app without debug, WaitForSingleObject is very, very fast.

Why does this happen? Is it because of Messages that the IDE sends? Or is it because of the compiler?

This is not affecting me a lot. I just think this issue is really annoying.

Edit: I am using Delphi 2010.

like image 597
Rafael Colucci Avatar asked Dec 31 '25 12:12

Rafael Colucci


1 Answers

I really doubt that WaitForSingleObject is in fact the ONLY thing that gets slower. Rather, it is probable that almost everything gets slower, when you run with debugging on.

I find that far more than Win32 API calls, calls to OutputdebugString slow me down, and anything that the IDE chooses to log in the event view, really, because a big load of these event or output messages, slows the IDE, the debugger, and thus the program that I'm debugging, a lot.

Try turning off the event view checkboxes in the configuration menu and see if EVERYTHING gets faster.

It's in Tools -> Options, as shown by the OP in his image, which I've also added here, for handy access: enter image description here

like image 92
Warren P Avatar answered Jan 05 '26 23:01

Warren P



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!