Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Difference between debug and release

What are the differences between debug and release builds for a Cocoa application? I know the debug version contains additional information for debugging but what else is different?

like image 241
er.mobileapp Avatar asked Mar 11 '11 08:03

er.mobileapp


People also ask

What is the difference between debug and Release mode?

By default, Debug includes debug information in the compiled files (allowing easy debugging) while Release usually has optimizations enabled. As far as conditional compilation goes, they each define different symbols that can be checked in your program, but they are language-specific macros.

Does debug or Release build faster?

Default Debug build is x240 times slower than default Release build. With all the aforementioned settings enabled, Fast Debug build is only x3 times slower than Release build (and that's with optimization still disabled!). The total improvement of Fast Debug over default Debug is 77x times.

How much faster is Release than debug?

An APK compiled with Release mode is optimized and much faster but you cant use debug/breakpoint etc... Release version is faster, even 3 times faster, depends on many different factors...

Is debug slower than Release?

Release mode is way more slower than debug mode for user defined functions.


2 Answers

I quote

"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."

Courtesy of google and user mcdeeiis http://haacked.com/archive/2004/02/14/difference-between-debug-vs-release-build.aspx

This is a pretty solid explanation for all programming languages

like image 54
Candyfloss Avatar answered Sep 28 '22 03:09

Candyfloss


The release version is more optimized for better performance and smaller size.

Also from personal practice I can say that it's useful to turn on more warnings in release configuration to know which methods are not used, which methods don't have declaration where signed/unsigned are being compared as well as other useful stuff.

like image 33
Eimantas Avatar answered Sep 28 '22 04:09

Eimantas