ios - Extremely long compilation times with Swift in Xcode -


i have 3 ios projects:

  • first 1 - 35k swift loc, swift 2.1 (or 2.0?), compiled using xcode 7.2.3
  • second 1 - 15k swift loc, swift 2.3, compiled using xcode 8.2.1
  • third 1 - 15k swift loc, swift 3.0, compiled using xcode 8.2.1

the compile times of these abysmal (10+ minutes clean build), , development on each 1 of these slowing crawl.

i have tried:

  • using whole module optimization
  • changing c dialect compiler default
  • analyzing build times project , optimizing bottlenecks (a few methods took 6-10s compile array concatenation, nil coalescing operators , such), shaved 15 seconds - unnoticeable difference
  • headermap_uses_vfs = yes
  • a few other don't remember now

i'm working on mac mini late 2014 ssd, 8gb ram & 2.6ghz i5, if matters.

anyone knows might cause that, or workarounds now? i've read on , other places, seems unresolved compiler issue.

edit: yes, i'm using cocoapods dependencies. i'll try moving carthage , see happens.

try set following in build settings workaround. assuming have 1 target.

  1. set build active architecture yes.
  2. set optimization level none [-onone]
  3. add user-defined setting called "swift_whole_module_optimization" value "yes"
  4. empty derived data , build.

you can use tool analyze slow compiling swift files: https://github.com/robertgummesson/buildtimeanalyzer-for-xcode

i experiencing build times taking 6-7 minutes. moved away cocoapods , started using carthage helped clean builds. builds still taking 3 minutes. biggest improvement came steps mentioned above.

update

instead of adding user-defined setting, on debug build set optimization level 'fast, whole module optimization'. in other swift flags debug build add '-onone'.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -