<div dir="ltr">Just running a quick trial before and after I made this change in our project, we were previously seeing builds of our main target that took just under 13min. With this hack, a clean debug build takes about 4.5min.<div><br></div><div>Ben</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 1, 2016 at 1:33 PM, Ben Asher <span dir="ltr"><<a href="mailto:benasher44@gmail.com" target="_blank">benasher44@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Okay I think that worked! And just to clarify, you meant set SWIFT_OPTIMIZATION_LEVEL = -Owholemodule and OTHER_SWIFT_FLAGS = -Onone ?<div><br></div><div>I'll file a radar this afternoon with some details and DM you the number.</div><div><br></div><div>Thanks again!</div><div><br></div><div>Ben</div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Thu, Dec 1, 2016 at 1:10 PM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Xcode needs to know that you're building in WMO mode, so rather than putting -whole-module-optimization in your "Other Swift Flags", put -Onone there. It's an ugly hack but it should work in the near term.<br>
<br>
We do want to work to make this drastic speed difference go away, so if you're able we (at Apple) would love to have a source drop of your Swift 3 project, for additional data on where the problems are. Mind filing a Radar?<br>
<br>
Best,<br>
Jordan<br>
<div><div class="m_-7790787871724555883h5"><br>
<br>
> On Dec 1, 2016, at 11:51, Ben Asher via swift-dev <<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>> wrote:<br>
><br>
> Hello! Someone recently tipped me off to using -whole-module-optimization flag with -Onone for use during debug builds to speed up compile times. In our project, the speedup feels quite dramatic, but when it gets to the linking step (after compiling both Swift and Obj-C in the project) it fails because ld can't find the individual object files that normally get emitted during the debug-type build presumably because -whole-module-optimization only emits one (and this isn't a normal "-Owholemodule"-type build which works fine).<br>
><br>
> I can't seem to reproduce this outside of Xcode, but I was curious if anyone has tried this and knows of a workaround to get -whole-module-optimization to work with -Onone in Xcode?<br>
><br>
> I'm currently using Xcode 8.1 (App Store build) and Swift 3 on macOS Sierra.<br>
><br>
> Thanks!<br>
><br>
> Ben<br>
</div></div>> ______________________________<wbr>_________________<br>
> swift-dev mailing list<br>
> <a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-dev" rel="noreferrer" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-dev</a><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_-7790787871724555883gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Ben</div></div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Ben</div></div></div></div>
</div>