Xcode 调试和发布之间的区别
Cocoa 应用程序的调试和发布版本之间有什么区别?我知道调试版本包含用于调试的附加信息,但还有什么不同?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我引用
“它们之间最大的区别是:
在调试版本中,会发出完整的符号调试信息以帮助调试应用程序,并且不考虑代码优化。
在发布版本中,不会发出符号调试信息,并且会优化代码执行。
此外,由于符号信息不会在发布版本中发出,因此最终可执行文件的大小小于调试可执行文件。
由于编译器优化或内存布局或初始化方面的差异,人们可能会在发布版本中看到有趣的错误。这些通常被称为“仅发布错误”:)
就执行速度而言,发布的可执行文件肯定会执行得更快,但这种差异并不总是很重要。”
由 google 和用户 mcdeeiis 提供
http://haacked.com/archive /2004/02/14/difference- Between-debug-vs-release-build.aspx
这是对所有编程语言的相当可靠的解释
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
发布版本进行了更优化,具有更好的性能和更小的尺寸。
另外,从个人实践来看,我可以说,在发布配置中打开更多警告以了解未使用哪些方法、哪些方法没有比较有符号/无符号的声明以及其他有用的内容是有用的。
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.