Click here to Skip to main content
15,883,623 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a Visual Basic .Net application I am compiling in Visual Studio 2012 (build 2 or 3) and I have found that the Release version shows the form much slower (7 seconds) than the Debug version (1 second).

Once loaded the Release version is quicker at processing. I have removed a couple of external references to see if they were causing this but they weren't.

Does anyone have any advice please?

Thanks.
Posted

1 solution

If you are talking about hitting the "play" button in Visual Studio and waiting for the form to show up, then I have some idea's...

First, debug builds are incremental and do not have any compiler optimizations, which means that they will probably build a lot faster. This means that the compiler generates the code, debugger attaches, and the form pops up pretty quickly.

Release builds, depending on what you've changed, may need to be a full build, which with compiler optimizations (loop unrolling, inlining, unreferenced variable removal, etc) can take much longer to build than a debug build. This causes VS to sit there and stare at you (but there is a progress bar at the bottom), then pop up the form. Yes, this can take longer.

If you are running the program by double clicking the .EXE file in the bin\Debug or bin\Release, I bet that its not noticeable with the time difference of executing the two files. The release one may process faster though after it starts up. It really depends on your code that happens before it shows the first form, since the interpreter has to go through and JIT the code.
 
Share this answer
 
Comments
codetowns 23-Jun-13 5:32am    
Well thanks for that. Strangely they compile from the "play" button at about the same speed. It is running the bin\Release\EXE that has the delay.

One thing I have noticed and perhaps I should have mentioned is that Visual Studio sometimes complains that a customised control I am using (from x86 times) should be built for the target x64 processor. All appears to work fine in the EXE but could this be what is slowing down the Release version?

Anyone know what would VS need me to do to the control?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900