Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Is there any differences between the Debug build and the Release build in regards to performance? Different IL generated?

Does the "Optimize code" option in the project change anything in Debug and Release?
Posted
Comments
Sergey Alexandrovich Kryukov 11-Nov-11 2:28am    
Different options, no more. Everything is literally translated to some command line to CSC.EXE. But as to the result... You can disassemble to IL and see. :-) Interesting to know, so I vote 5 for the question.
--SA
Mehdi Gholam 11-Nov-11 2:42am    
Interestingly sometimes debug builds are faster, and I have seen some NOP instructions in there.
Sergey Alexandrovich Kryukov 11-Nov-11 2:53am    
Interesting. You could try to remove all NOPs from decompiled IL code and compile it back and than compare the speed. What if NOPs accelerate execution? :-)
--SA
Mehdi Gholam 11-Nov-11 3:04am    
The only difference is debug uses more memory, in my test 592mb for debug, 586mb for release, the timings are the same for both.

This link-[Debug vs. Release - The Best of Both Worlds][^] might helped you to get your answer.
or also look there-[Performance differences between debug and release builds][^] having similar question with some nice solution.
 
Share this answer
 
v2
Comments
Mehdi Gholam 11-Nov-11 3:05am    
Nice informative links, 5'ed
RaviRanjanKr 11-Nov-11 3:17am    
Thanks Mehdi :)
When you build the application in Release mode, the debug symbols are not baked into the assembly, so you cannot debug it using Visual Studio .NET or other source code debuggers. What's cool is that the code is also optimized during this build operation. And, all calls to Debug class methods in your code are disabled while calls to Trace class methods are left. (from here)
 
Share this answer
 

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