What is the difference between debug build and release build?

 Posted by Raja on 11/13/2008 | Category: .NET Framework Interview questions | Views: 21225

The biggest difference between these is that:

In a debug build the complete symbolic debug information is emitted to help while debugging applications and also the code optimization is not taken into account.

While in release build the symbolic debug info is not emitted and the code execution is optimized.
Also, because the symbolic info is not emitted in a release build, the size of the final executable is lesser than a debug executable.

One can expect to see funny errors in release builds due to compiler optimizations or differences in memory layout or initialization. These are ususally referred to as Release - Only bugs :)

In terms of execution speed, a release executable will execute faster for sure, but not always will this different be significant.

Source: http://www.computergenome.com/programmers_arena/debug_and_releasebuild.html | Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Robonmatt on: 6/3/2013 | Points: 10
Debug mode and Release mode are different configurations for building your .Net project. Programmers generally use the Debug mode for debugging step by step their .Net project and select the Release mode for the final build of Assembly file (.dll or .exe).

Debug mode is faster : The Release mode enables optimizations and generates without any debug data, so it is fully optimized. . Lots of your code could be completely removed or rewritten in Release mode. The resulting executable will most likely not match up with your written code. Because of this release mode will run faster than debug mode due to the optimizations.

more on this topic



Login to post response