Differences between compiling for i386 vs x86_64 in Xcode?

后端 未结 3 1705
时光说笑
时光说笑 2021-02-09 04:26

What are the differences between compiling a Mac app in Xcode with the Active Architecture set to i386 vs x86_64 (chosen in the drop down at the top left of the main window)? In

3条回答
  •  你的背包
    2021-02-09 05:12

    32/64-bit Universal -- i386, x86_64, ppc

    32-bit Universal -- i386, ppc

    64-bit Intel -- 64 bit Intel only

    ppc64 is no longer supported.


    x86_64 binaries are faster for a number of reasons; faster ABI, more registers, on many (most & all new machines) machines the kernel is 64 bit & kernel calls are faster, etc.etc.etc...

    While 64 bit has a bit of memory overhead directly related, generally, to how pointer heavy your app's data structures are, keep in mind that 32 bit applications drag in the 32 bit versions of all frameworks. If yours is the only 32 bit app on the system, it is going to incur a massive amount of overhead compare to the 64 bit version.

    64 bit apps also enjoy the latest and greatest Objective-C ABI; synthesized ivars, non-fragile ivars, unified C++/ObjC exceptions, zero-cost @try blocks etc... and there are a number of optimizations that are only possible in 64 bit, too.

提交回复
热议问题