<div dir="ltr">I get the impression that there's no immediate solution. Will Swift 3.0 improve build times?<div><div><br></div><div>-david</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 22, 2016 at 2:23 PM, Daniel Dunbar <span dir="ltr"><<a href="mailto:daniel_dunbar@apple.com" target="_blank">daniel_dunbar@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">It doesn't help with this problem, but I use:<div><div> -Xfrontend -solver-memory-threshold -Xfronted <SOME-BIG-NUMBER-BUT-LESS-THAN-THE-DEFAULT></div><div>as a way to cause the compiler to give up sooner.</div><div><br></div><div>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><br></div><div> - Daniel</div><div><br></div><div><blockquote type="cite"><div><div><div>On Jan 22, 2016, at 12:25 PM, David Turnbull via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:</div><br></div></div><div><div><div><div dir="ltr">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><br></div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(112,61,170)"><span style="color:rgb(187,44,162)">public</span><span> </span><span style="color:rgb(187,44,162)">func</span><span> ortho<T:</span>FloatingPointScalarType<span>></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> (left:<span style="color:rgb(112,61,170)">T</span>, <span style="color:rgb(187,44,162)">_</span> right:<span style="color:rgb(112,61,170)">T</span>, <span style="color:rgb(187,44,162)">_</span> bottom:<span style="color:rgb(112,61,170)">T</span>, <span style="color:rgb(187,44,162)">_</span> top:<span style="color:rgb(112,61,170)">T</span>) -> <span style="color:rgb(112,61,170)">Matrix4x4</span><<span style="color:rgb(79,129,135)">T</span>></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">{</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> <span style="color:rgb(187,44,162)">let</span> t0:<span style="color:rgb(112,61,170)">T</span> = <span style="color:rgb(112,61,170)">T</span>(<span style="color:rgb(39,42,216)">0</span>)</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> <span style="color:rgb(187,44,162)">let</span> t1:<span style="color:rgb(112,61,170)">T</span> = <span style="color:rgb(112,61,170)">T</span>(<span style="color:rgb(39,42,216)">1</span>)</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> <span style="color:rgb(187,44,162)">let</span> t2:<span style="color:rgb(112,61,170)">T</span> = <span style="color:rgb(112,61,170)">T</span>(<span style="color:rgb(39,42,216)">2</span>)</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> <span style="color:rgb(187,44,162)">let</span> r00:<span style="color:rgb(112,61,170)">T</span> = t2 / (right - left)</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> <span style="color:rgb(187,44,162)">let</span> r11:<span style="color:rgb(112,61,170)">T</span> = t2 / (top - bottom)</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> <span style="color:rgb(187,44,162)">let</span> r30:<span style="color:rgb(112,61,170)">T</span> = -(right + left) / (right - left)</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> <span style="color:rgb(187,44,162)">let</span> r31:<span style="color:rgb(112,61,170)">T</span> = -(top + bottom) / (top - bottom)</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> <span style="color:rgb(187,44,162)">return</span> Matrix4x4<<span style="color:rgb(79,129,135)">T</span>>(</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> r00, t0, t0, t0,</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> t0, r11, t0, t0,</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> t0, t0, -t1, t0,</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> r30, r31, t0, t1</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> )</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">}</div></div><div><br></div><div>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><br></div><div>-david <a href="https://github.com/AE9RB/SwiftGL" target="_blank">https://github.com/AE9RB/SwiftGL</a></div></div></div></div>
_______________________________________________<br>swift-users mailing list<br><a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div></div></div>