<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">It doesn't help with this problem, but I use:<div class=""><div class="">&nbsp; -Xfrontend -solver-memory-threshold -Xfronted &lt;SOME-BIG-NUMBER-BUT-LESS-THAN-THE-DEFAULT&gt;</div><div class="">as a way to cause the compiler to give up sooner.</div><div class=""><br class=""></div><div class="">This helps some to identify new troublesome code as it is written, but unfortunately doesn't really help with speeding up code like you posted.</div><div class=""><br class=""></div><div class="">&nbsp;- Daniel</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Jan 22, 2016, at 12:25 PM, David Turnbull via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I'm trying to improve compile times in my project. I've been using "-Xfrontend -debug-time-function-bodies" to find to sore spots. Here's something that takes 1300ms to compile:<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="color:rgb(187,44,162)" class="">public</span><span style="" class=""> </span><span style="color:rgb(187,44,162)" class="">func</span><span style="" class=""> ortho&lt;T:</span>FloatingPointScalarType<span style="" class="">&gt;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; (left:<span style="color:rgb(112,61,170)" class="">T</span>, <span style="color:rgb(187,44,162)" class="">_</span> right:<span style="color:rgb(112,61,170)" class="">T</span>, <span style="color:rgb(187,44,162)" class="">_</span> bottom:<span style="color:rgb(112,61,170)" class="">T</span>, <span style="color:rgb(187,44,162)" class="">_</span> top:<span style="color:rgb(112,61,170)" class="">T</span>) -&gt; <span style="color:rgb(112,61,170)" class="">Matrix4x4</span>&lt;<span style="color:rgb(79,129,135)" class="">T</span>&gt;</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">{</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">let</span> t0:<span style="color:rgb(112,61,170)" class="">T</span> = <span style="color:rgb(112,61,170)" class="">T</span>(<span style="color:rgb(39,42,216)" class="">0</span>)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">let</span> t1:<span style="color:rgb(112,61,170)" class="">T</span> = <span style="color:rgb(112,61,170)" class="">T</span>(<span style="color:rgb(39,42,216)" class="">1</span>)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">let</span> t2:<span style="color:rgb(112,61,170)" class="">T</span> = <span style="color:rgb(112,61,170)" class="">T</span>(<span style="color:rgb(39,42,216)" class="">2</span>)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">let</span> r00:<span style="color:rgb(112,61,170)" class="">T</span> = t2 / (right - left)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">let</span> r11:<span style="color:rgb(112,61,170)" class="">T</span> = t2 / (top - bottom)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">let</span> r30:<span style="color:rgb(112,61,170)" class="">T</span> = -(right + left) / (right - left)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">let</span> r31:<span style="color:rgb(112,61,170)" class="">T</span> = -(top + bottom) / (top - bottom)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">return</span> Matrix4x4&lt;<span style="color:rgb(79,129,135)" class="">T</span>&gt;(</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; r00, t0,&nbsp; t0,&nbsp; t0,</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; t0,&nbsp; r11, t0,&nbsp; t0,</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; t0,&nbsp; t0,&nbsp; -t1, t0,</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; r30, r31, t0,&nbsp; t1</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; )</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div></div><div class=""><br class=""></div><div class="">I'm not sure what to do from here. My program is unavoidably math heavy. Every new line of code adds about 60ms of compile time. And that's after I spend time typing in hints and splitting up the arithmetic.</div><div class=""><br class=""></div><div class="">-david &nbsp;<a href="https://github.com/AE9RB/SwiftGL" class="">https://github.com/AE9RB/SwiftGL</a></div></div>
_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></div></body></html>