Main Site Documentation

Program runs faster in Debug mode. Why?



I’m using FEZRaptor to read & write serial ports (up to 5 serial ports connected to a board). My program decide which state it goes to based on the inputs of all the ports (a simple state machine programming model).

I’m using multithread to process my serial port ReadLine and data received, my questions is why my program runs faster (response immediately going to next step) in Debug mode in Visual Studio? In comparison, while i boot the device itself (without Visual Studio debug), the state machine takes aboue 1s to go to next step?

Any idea?

By any chance that the VS take processing load from the FEZRaptor while running debug mode?

or how do i further dianose what is the culprit?



Do you have a lot of Debug.Print calls in your code?

Edit: Anyways it is a known problem.
Here is more information about it:


Hi Architect,

My Debug runs faster than straight boot on the device. I tried comment out the Debug.WriteLine, it’s the same.


@ Architect, the links help. Thanks!