慢速测试文件编译在Swift 1.2,Xcode 6.3.1 [英] Slow test file compilation in Swift 1.2, Xcode 6.3.1
问题描述
在将项目从Xcode 6.2迁移到6.3.1后,我经历了对swift单元测试文件的慢得多的编译。
I experienced much slower compilation of the swift unit test files after migrating the project from Xcode 6.2 to 6.3.1.
我的单元测试使用Quick / Nimble框架。另外在每个测试文件中我有:
My unit test use Quick/Nimble framework. Also in each test file I have:
import MyApp
有趣的是,当我注释掉导入,编译是闪电般快。我测试了一些虚拟单元测试文件,实际上不使用我的应用程序的任何代码。但是导入对编译时间有很大的影响。
The interesting thing is that when I comment out that import, the compilation is lightning fast. I tested it out on some dummy unit test files, that in fact don't use any of my application's code. But that import makes huge difference for the compilation time.
我没有注意到使用Xcode 6 - 6.2时的巨大影响。现在有什么想法如何提高编译速度?
I didn't observe that big impact when using Xcode 6 - 6.2. Do you have any ideas how to improve the compilation speed now?
推荐答案
根据 http://devforums.apple.com/message/1128702#1128702 。在构建设置中启用整个模块优化
会导致问题出现。
According to one of the replies in http://devforums.apple.com/message/1128702#1128702 . Enabling Whole Module Optimization
in Build Settings makes the issue walked around.
这篇关于慢速测试文件编译在Swift 1.2,Xcode 6.3.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!