Swift: MergeSwiftModule takes 20+ seconds after incremental builds

Originator:rix.rob
Number:rdar://20661375 Date Originated:22-Apr-2015 09:06 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6.3.1 (6D1002)
Classification:Other Bug Reproducible:Always
 
Summary:
In Xcode 6.3.1, incremental builds spend more than 20 seconds in MergeSwiftModule.


Steps to Reproduce:
1. Compile a Swift program consisting of multiple files I guess? I don’t really know what all the necessary preconditions are.
2. Pick a file which, when changed, will not require other files to be rebuilt.
3. Add a character to that file, delete it again, and save.
4. Build.


Expected Results:
I expected the build to be so quick as to be unnoticeable.


Actual Results:
Rebuilding the file incrementally: ultraspeedy. But then upwards of 20 seconds spent in “MergeSwiftModule”:

    MergeSwiftModule normal x86_64 /Users/rob/Library/Developer/Xcode/DerivedData/Tesseract-ayeelaykavrrpeemymskjterqjzv/Build/Intermediates/Tesseract.build/Debug/Tesseract.build/Objects-normal/x86_64/Tesseract.swiftmodule


Regression:
This didn’t happen in 6.3, or any other previous version of Xcode.


Notes:
I’ve attached a sample of the swift process which is doing this merge.

Enabling Whole Module Optimization does not improve matters, it makes it worse. Of course it does; it throws away incremental builds altogether! (cf https://twitter.com/satefan/status/586235706395258881 for context)

Please, if there is a workaround, I’d love to hear it. This delay is making it very difficult for me to continue working on things that make me happy.

Comments


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!