[swift-dev] Swift incremental compile profiling

Brian Gesiak modocache at gmail.com
Mon Aug 29 22:12:53 CDT 2016

Thank you, Jordan!

I had guessed there wouldn't be much low-hanging fruit here -- I'm sure a
ton of work has been put into improving compilation time, after all. Thanks
for all the great explanations.

The one thing we *could* do here is improve -driver-show-incremental. I
> haven’t used it in a while so I don’t actually know where I left off with
> that.

I assume you mean showing more information when this option is specified.
Let me know if there's something more. Also, do you mind if I create a JIRA
task for this?

> One thing we *have* noticed is that the cost for each frontend task for a
> project with 1500 tiny, non-dependent Swift files and a bridging header is
> much higher than it is for Clang. People have blamed Swift having to open
> and parse every file in the project, but I don’t actually believe this is
> the case; time spent in Parse is *tiny* for these functions. It would be
> very interesting for someone to investigate where this time is going.
> (There’s a similar project in SR-2461
> <https://bugs.swift.org/browse/SR-2461>; I haven’t checked whether the
> project we have in Radar is appropriately clean of user info to share.

I looked into this a bit. Compiling 1501 Swift files takes 38 seconds on my
Linux VM (https://gist.github.com/modocache/7b6e2f0c17f65e8418c2acf5e1c82154),
compiling 1501 C files using clang takes 22 seconds (
https://gist.github.com/modocache/ceeefaa76befd738e62e078dd2e186f1). These
numbers don't seem outrageous to me, so I guess the problem could be
specific to bridging headers. I don't have a macOS environment capable of
building Swift right now, but I'll try to look into this more once Xcode 8
is released.

> I guess that’s about it. Oh, and I keep meaning to write tools to
> manipulate the data in the swiftdeps YAML files, but that can happen at any
> time. You’re welcome to contribute something before I get to it.

What do you have in mind? A command-line tool to add input files, update
their timestamps, that sort of thing?

- Brian Gesiak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20160829/fa6a72eb/attachment.html>

More information about the swift-dev mailing list