How to decrease build times / speed up compile time in Xcode?

后端 未结 14 1557
悲&欢浪女
悲&欢浪女 2020-12-04 06:40

What strategies can be used in general to decrease build times for any Xcode project? I\'m mostly interested in Xcode specific strategies.

I\'m doi

相关标签:
14条回答
  • 2020-12-04 07:30

    one word: TmpDisk

    1. Use TmpDisk to Create a 1.5Gb RAM disk
    2. Change Xcode > Preferences > Location > Derived Data to /Volumes/1.5Gb/xcode data
    3. Enjoy the speed!
    0 讨论(0)
  • 2020-12-04 07:33

    The number of threads Xcode will use to perform tasks defaults to the same number of cores your CPU has. For example, a Mac with an Intel Core i7 has two cores, so by default Xcode will use a maximum of two threads. Since compile times are often I/O-bound rather than CPU-bound, increasing the number of threads Xcode uses can provide a significant performance boost for compiles.

    Try configuring Xcode to use 3, 4 or 8 threads and see which one provides the best performance for your use case.

    You can set the number of processes Xcode uses from Terminal as follows:

    defaults write com.apple.Xcode PBXNumberOfParallelBuildSubtasks 4

    Please see Xcode User Defaults for more information.

    0 讨论(0)
提交回复
热议问题