0

Since there are several compilers in Xcode, my question here is which one is the best among them from performance point of view and what's the difference between them. Some of the compilers we have:

  • GCC 4.2
  • LLVM GCC 4.2
  • LLVM compiler 1.5

I've done some quick test myself but haven't found much difference? Also, in my Build Settings I have Apple LLVM compiler 4.2, but at llvm.org, the recent latest version of LLVM is 3.2. Can anyone explain that why?

zoul
  • 102,279
  • 44
  • 260
  • 354
AKB
  • 132
  • 13
  • do you mean performance (speed?) of the compilation process, or performance (execution speed? size?) of the resulting binary? – Thilo Mar 25 '13 at 07:35
  • maybe related: http://stackoverflow.com/questions/3739783/iphone-gcc-llvm-gcc-or-llvm?rq=1 – Thilo Mar 25 '13 at 07:36

2 Answers2

2

There’s no “overall performance” compiler rating, the various metrics often go against each other. For example, getting a binary well optimized for speed may require bigger binary size and compilation times.

The good thing is that none of it matters to you, because they way you write your code has up to several orders of magnitude more effect of your binary size and speed. Just pick LLVM, it’s the only “standard” choice.

As for the version difference, I think that Apple just uses their own versioning scheme for their branded compiler:

$ clang --version
Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn)
zoul
  • 102,279
  • 44
  • 260
  • 354
1

clang ( http://clang.llvm.org/ )

llvm gcc, is not maintained anymore if i am not wrong.

Phong
  • 6,600
  • 4
  • 32
  • 61