Marcin
Marcin

Reputation: 1823

Slow test file compilation in Swift 1.2, Xcode 6.3.1

I experienced much slower compilation of the swift unit test files after migrating the project from Xcode 6.2 to 6.3.1.

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.

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?

Upvotes: 2

Views: 1438

Answers (3)

PeteSE4
PeteSE4

Reputation: 327

Apple released Xcode 6.3.2 on 18th May (yesterday) which seems to cite slow compile times. Does the update fix your issue?

Upvotes: 0

WeZZard
WeZZard

Reputation: 3546

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.

Upvotes: 2

Mark McCorkle
Mark McCorkle

Reputation: 9414

Obviously this would involve seeing your code but try to not use so many concatenations for your strings and strongly type your vars.

You can see which file is taking a long time to compile by watching the build process in Xcode file by file. It's the last tab, touch the running build process and you'll see each file as it's being compiled.

Upvotes: 0

Related Questions