Xcode Difference between debug and release

前提是你 提交于 2019-12-17 23:36:43

问题


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?


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/5270586/xcode-difference-between-debug-and-release

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!