Swift takes forever to compile source file with chained generic operators

Originator:jum
Number:rdar://18994321 Date Originated:15-Nov-2014 06:35 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6.1
Classification:Performance Reproducible:Always
 
Summary:
Trying to compile some Swift code that uses the Argo framework (which defines generic operators for transferring JSON data into model objects) takes forever (didn’t wait for the compiler to finish, but after about 15 minutes it still wasn’t finished compiling that single file with ~50 lines of source code)

Steps to Reproduce:
- unpack and open the enclosed „Bongle“ workspace
- try to build

Expected Results:
Since the source files are not too large, I’d expect the Bongle project to build within a few seconds.

Actual Results:
The source file „BongtvChannel.swift“ takes forever to compile. I haven’t been able to wait whether it completes at all, but at least after about 15 minutes is still wasn’t done.

Regression:
When commenting out the chained operators in the decode() function, everything is back to normal performance, so it must be related to that operator chaining.

Comments

No measurable improvement with Xcode 6.3 beta: I aborted the build after about 15 min wall clock time (~10 min CPU time for the swift compiler, which meanwhile used more than 5 GB physical memory) without the build completing compilation of the file "BongtvChannel.swift"...

I have attached an updated version of the sample project ("Bongle 2.zip" - had to fix one error to make it compile with Swift 1.2). Just open the workspace and build the "Bongle" scheme - you'll notice the issue very soon...

Apple Developer Relations on 10-Feb-2015 09:50 PM

We believe this issue has been addressed in the latest Xcode 6.3 beta, including iOS 8.3 SDK with Swift 1.2.

Please test with this release. If you still have issues, please include any relevant logs or information that could help us investigate.

This is a pre-release version of the complete Xcode developer toolset for Mac, iPhone, iPad, and Apple Watch. This release requires OS X Yosemite.

Xcode 6.3 - Build 6D520o


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!