[swift-dev] Imroving external dependency management in swift

Asif Mohd arshadasif0312 at gmail.com
Mon Jul 17 19:11:44 CDT 2017

As our iOS project has grown, compile times have also increased, all the
way upto 12 mins for a clean build, for around 600 swift files.

I was going through how to improve build times and found this archive

On Wed, Apr 13, 2016 at 5:18 PM, Samantha John <sam at
gethopscotch.com <https://lists.swift.org/mailman/listinfo/swift-dev>>
> Hi Jordan,
> The thing that sticks out in the dependency analysis is the treatment of external dependencies. The entire module has the same list of external dependencies which causes a lot of needless recompiles- especially if you start with a large swift project and slowly start to move things into modules.
> So to me the lowest hanging fruit would be to only mark files for recompilation that explicitly import the external dependency. This seems pretty safe since you can't compile unless the dependency is explicitly imported. Has anyone on the list tried this before?
We've been planning to move our project files to smaller frameworks/modules.
But the problem we'd face would be changing any file in any of the smaller
framework/module would lead to a full rebuild because this framework will
be listed as a dependency in every swift file in the project.

So i'm planning to only mark the current imports on the swift files as the
external dependency for that file.
Before i begin i wanted to confirm if this will work, or if someone has
already tried this.
Any help is appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20170718/ff697531/attachment.html>

More information about the swift-dev mailing list