title: Launching VS Profiler boosts Application Performance x20?
body: <p><strong>EDIT 1</strong><br>
  <em>I do not exclude at all this might be caused by something very basic side effect of using the Profiler (some faulty setting in my "regular" project)</em> </p>
  
  <p>I wanted to improve Computing Time in my Application, so I decided to go through a thorough profiling analysis.
  So <strong>I just launched a .Net Memory Allocation Profiling</strong> to analyze my App. <br> I was completely stunned to watch <strong>computing go x20 times faster</strong> !</p>
  
  <p>Application consists of Reading Data from Binary Files with BackgroundWorkers, process them, <br>and store results into an MSSQL DB. Each round usually takes 20 seconds, and while profiling it barely takes 1 sec. I checked and made sure results are coherent in both cases.</p>
  
  <p>A .Net experimented friend told me the profiler optimizes threading and "somehow" finds its way through thread Locks and Bottlenecks, but I just can't believe it. </p>
  
  <p>So my questions are : </p>
  
   <ol>
   <li>WHAT EXACTLY HAPPENS, HOW, and WHY ?</li>
   <li>How to make my code behave like that natively ?</li>
  </ol>
  
  <p><strong>EDIT 2</strong><br>
  I <strong>KNOW</strong> this sounds crazy and unbelievable. I myself am still very suspicious.But it's TRUE.<br>
  The SAME code runs really fast when run by the profiler.
  I use the SAME test data, and watch the SAME computing output.
  I am not able to give out a simple reproducing project, as it is a relatively big framework.
  I am using the Visual Studio 2010 Profiler.
  <br><br>I'll be giving as much details as I can on the flow and definitely will post a clue as soon as I find it.</p>
  
  <p><strong>Regular RUN LOGS :</strong><br> 
  03/23/2011 18:04:34 | 180434.621 | SIMULATING SET [5]-[1]-[5 PC-1 0 [SET 1/48]<br>
  03/23/2011 18:05:01 | 180501.271 |  <strong>PROCESSING TIME : 00:00:26.6515244</strong>
  <br>etc..</p>
  
  <p><strong>Profiler Run LOGS :</strong><br>
  03/24/2011 11:38:15 | 113815.592 | SIMULATING SET [5]-[1]-[5 PC-1 0 [SET 1/48]<br>
  03/24/2011 11:38:17 | 113817.350 |  <strong>PROCESSING TIME : 00:00:01.7581005</strong><br>
  <br>etc..</p>
  
  <p><strong>EDIT 3 : The Clue</strong><br>
  Ok ok ok My BAD(I warned on such a possibility on edit 1, as this was too unbelievable. Sorry) @Watts suggested to check if I was in debug or release mode.
  Which I had Already done. BUT @SnowBear pointed out that there are two different things : to run debug version of software and to run a software under debugger
  I made sure that the active configuration was RELEASE in both Build And Execution is VS2010. However, as I was just going nuts I decided to launch the Application directly from the exe file in the bin/release. And voilà... processes were taking 1 second each.
  Running the Profiler get you out of debug mode (whether you're in release or debug mode)
  that's what put me into confusion. <br>
  Thanks to All Case Closed.</p>