What's the difference between a Debug vs Release Build?

0 comments suggest edit

That’s a question I’ve been asked several times, and to be honest, I really didn’t know all the details. Till now. Read on.

Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.



26 responses

  1. Avatar for mcdeeiis
    mcdeeiis May 10th, 2006

    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.

  2. Avatar for Shirish Kulkarni
    Shirish Kulkarni August 22nd, 2006

    It's observed that some of the MSVC++ calls work find in the debug mode, but fail functionally in the release builds.
    These are specifically referring to the FreeExtra call used in our application.
    The debug mode shows a clear reducion in the private memory bytes, while release mode, does not show any changes.
    Any help / pointers will be appreciatd ...


  3. Avatar for Joel
    Joel January 8th, 2007

    * the sample code below written in VB.NET 2005 shows some of the "release" bug. Code below is working in debug mode but not in release mode.


    Dim strdate As String
    Dim strdate2 As String
    Dim strlast As Integer = 1
    strdate = Format(Date.Now, "MM/dd/yyyy").ToString
    strdate2 = Format(Date.Now, "MM/dd/yyyy").ToString
    If strdate.ToString <> strdate2.ToString Then
    If strlast = 0 Then
    End If
    End If

  4. Avatar for Jay
    Jay January 2nd, 2008

    in Debug mode the complete debug symbol is emitted so that the code optimization is not taken place
    but in release mode the complete debut symbol is not emitted so that code optimization is taken place

  5. Avatar for adeel
    adeel April 22nd, 2008

    The debug build is created with some embedded information which allows the debugger to debug the application and exposed the runtime behavior of the application. On the down side, the debug build is a bit slower and inefficient in execution and larger in size.

  6. Avatar for arun
    arun May 3rd, 2008

    the last modifications in the project is stored in release foler why not in debug folder?

  7. Avatar for subrama
    subrama July 8th, 2008

    Debug is for everything but Release is for something

  8. Avatar for dingleberry
    dingleberry August 17th, 2008

    Arcane wizardry burn in hell!!!!!!!!!!!!!!!

  9. Avatar for Deepak
    Deepak August 18th, 2008

    please tell me which is better debug or build

  10. Avatar for Pandharinath
    Pandharinath November 3rd, 2008

    I have one question
    what is use of symbolic debug information ?
    which is in Debug build.
    And we can debug the code in Release mode then why symbolic debug information not required?

  11. Avatar for muthu.amr
    muthu.amr February 22nd, 2010

    Release mode will execute faster than debug mode and release mode takes lesser size than debug mode.

  12. Avatar for Radeev
    Radeev May 26th, 2010

    XML Comments and inline comments are removed in released build.

  13. Avatar for Akshat sharma
    Akshat sharma June 20th, 2010

    When you compile your application in release mode debug information is not generated and this is the option normally used when you want to deploy your application to client.debug mode is heavy since debugging info gets generated and is used while development to find out error in your code.
    When we are moving code to production then we make the mode as Release. Because there no debug is required and the execution also very fast in this mode due to the .pdb file formation will not happens.

  14. Avatar for Prashant Kalmodiya
    Prashant Kalmodiya June 22nd, 2010

    Debug build
    1. Basically this for developer
    2. Complier code optimization is OFF
    Release build
    1. Basically this for Client to whom you want to distribute the application
    2. Complier code optimization is ON

  15. Avatar for Hasan Dibas
    Hasan Dibas September 4th, 2010

    we use Debug during develpment cycle
    we use Release To deploy your project

  16. Avatar for Non-Sense
    Non-Sense October 19th, 2010

    I think the best difference is the spelling.

  17. Avatar for Ravinder Dhiman
    Ravinder Dhiman October 26th, 2010

    During the execution of vb.net program if any error produces then in debug version when we try to correct this error then large amount of data is added up into this program to interact with debugger. this large data increases the size of assembly as well as the speed of the program execution become slower.
    while in release version such large amount of data is not added up into that program. so in this mode the program can run fastly as stand alone program

  18. Avatar for kishore
    kishore May 24th, 2011

    if you compile in debug mode it run slowly but if you run in the release mode it run fast
    debug for developer to now what are the error in the program
    release for client to check the formance of the program and output coming what he expect or not

  19. Avatar for Nathon Dalton
    Nathon Dalton June 14th, 2011

    In debug mode...
    - Some batch optimizers are disabled.
    - Additional debugging paths are enabled.
    - More memory is used at runtime.
    - Scripts & images downloaded from WebResource.axd are not cached.
    Hope that helps!

  20. Avatar for AnilG
    AnilG September 2nd, 2011

    Debug Version is much different than Release.
    Debug version contains the symbolic information which is used for debugging purpose only and code optimization is off. This inturn increase the size of the debug. Where as the Release version contains no symbolic information and code optimization is ON. However, both the debug and release versions use the same source files for generating the respective versions, its the symbolic information and optimization that changes the CRC of the output file.

  21. Avatar for Gary
    Gary February 22nd, 2012

    By configuration:
    Debug version will include debug info, and no optimization;
    Release version will not include debug info and has optimization;
    By resulted .exe or .dll:
    Debug version has a bigger size, and runs slower;
    Release version has a smaller size and runs faster in general.
    Look at them in a higher level:
    They are just the compiled results from two sets of values for compiler/linker parameters.

  22. Avatar for sowmya m
    sowmya m June 6th, 2012

    Thanks Prashant kalmodiya..
    Urs is an awesome answer...

  23. Avatar for Tun
    Tun February 19th, 2013

    I used to publish the site with debug mode built. Is that wrong ?

  24. Avatar for Sugu
    Sugu July 25th, 2013

    Hey Mr Mcdeeiis,

    Please recheck the comment before posting..

    Difference between Debug Vs Release Build from MSDN is below..

    The Debug configuration of your program is
    compiled with full symbolic debug information and no optimization.
    Optimization complicates debugging, because the relationship between
    source code and generated instructions is more complex.

    Release configuration of your program contains no symbolic debug
    information and is fully optimized. Debug information can be generated
    in PDB files, depending on the compiler options that are used. Creating
    PDB files can be very useful if you later have to debug your release
    version. See Specify Symbol (.pdb) and Source Files in the Visual Studio Debugger

  25. Avatar for sst
    sst October 17th, 2013

    really u r nonsense only

  26. Avatar for Ashish Mishra
    Ashish Mishra February 5th, 2015

    Correct ..Both have their own rolls & importance...