iPhone GCC/LLVM GCC 还是 LLVM?

iPhone GCC / LLVM GCC or LLVM?(iPhone GCC/LLVM GCC 还是 LLVM?)

本文介绍了iPhone GCC/LLVM GCC 还是 LLVM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里问专家...

有人对哪种编译器最适合 iPhone 应用程序进行了性能测试吗?

Does anybody have made some performance test about which compiler is the best for iPhone apps?

因为我们可以选择:

  • GCC 4.2
  • LLVM GCC 4.2
  • LLVM 编译器 1.5

我想知道这 3 个中哪一个提供了最好的性能...

Im wondering which of the 3 offers the best performance...

我自己做了一些快速测试,但没有发现太大区别?

I've done some quick test myself but haven't found much difference?

您使用的是哪个编译器?

Which compiler are you using?

推荐答案

如果你看WWDC2010 会议视频 300,开发者工具联盟状态,您将看到 Apple 报告使用 LLVM 编译器构建的应用程序比 GCC 显着提高了性能(在某些情况下提高了 60%).可以通过将 Clang 解析器与 LLVM 编译器一起使用来进行其他改进.观看 Session 312 - What's New in the LLVM Compiler"了解更多信息,以及 WWDC 2009 上关于 LLVM 的会议(如果有的话).

If you watch the WWDC 2010 session video 300, the Developer Tools State of the Union, you will see that Apple reports significant performance increases for applications built using the LLVM compiler over GCC (up to 60% faster in certain cases). There are additional improvements that can be made by using the Clang parser with the LLVM compiler. Watch Session 312 - "What's New in the LLVM Compiler" for more on this, as well as the sessions on LLVM from WWDC 2009, if you have them.

在我的一个应用程序的非正式基准测试中,我看到从 GCC 到 LLVM 1.5 的速度提高了 20%,但这不是一个严格的测试,因此仅考虑轶事证据.

I saw a 20% speedup going from GCC to LLVM 1.5 in an informal benchmark within one of my applications, but it wasn't a rigorous test, so consider that only anecdotal evidence.

如果可以的话,我的建议是使用 Clang + LLVM(LLVM 编译器 1.5),以获得更快的构建时间、更高性能的应用程序和更好的编译器错误.如果您使用 C++ 代码或 Clang 解析器现在无法处理的其他内容,请使用 LLVM GCC 以在编译的应用程序中仍然获得性能优势.仅当由于某种原因失败时才使用 GCC.只需在构建设置中点击一个简单的开关,即可在最终应用程序中免费获得少量额外性能.

My recommendation is to use Clang + LLVM (LLVM Compiler 1.5) if you can for faster build times, more performant applications, and much better compiler errors. If you use C++ code or something else that the Clang parser cannot handle right now, use LLVM GCC to still get the performance benefits in your compiled application. Go to GCC only if that fails for some reason. It's a simple switch to hit in your build settings to gain even a small amount of extra performance for free in your end application.

Xcode 4 附带的 LLVM Compiler 2.0 完全支持 C++,并承诺对已编译的应用程序进行额外的优化,以及更多的编译时加速.Xcode 4 甚至使用 Clang 作为 IDE 中的语法高亮/代码校正引擎.Apple 在编译器方面的发展方向很明确.

LLVM Compiler 2.0, coming with Xcode 4, has full support for C++ and promises additional optimizations for compiled applications, along with more compile-time speedups. Xcode 4 even uses Clang as the syntax highlighting / code correction engine in the IDE. It's clear the direction that Apple is heading with their compilers.

这篇关于iPhone GCC/LLVM GCC 还是 LLVM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:iPhone GCC/LLVM GCC 还是 LLVM?

基础教程推荐