<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I think that my change exposed a latent performance bug in the constraint solver. Let’s followup in a bug report:<div class=""><br class=""></div><div class=""><a href="https://bugs.swift.org/browse/SR-5669" class="">https://bugs.swift.org/browse/SR-5669</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 9, 2017, at 16:47, Mark Lacey <<a href="mailto:mark.lacey@apple.com" class="">mark.lacey@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Aug 9, 2017, at 11:33 AM, Arnold Schwaighofer <<a href="mailto:aschwaighofer@apple.com" class="">aschwaighofer@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Mark do you have suggestions for Dave?</div></div></blockquote><div class=""><br class=""></div>I’d suggest something similar to what Pavel said. My usual first step is to look at the output of -Xfrontend -debug-constraints, which in cases like this tends to be so verbose that you have to kill the compile after a little while and a few megabytes of output and start reviewing that output. Key things to look for are “(assuming”, which is printed for each disjunction choice, and “(trying” which is printed before each attempt at trying a type binding.</div><div class=""><br class=""></div><div class="">I took a quick look at this and based on the before/after output it looks like perhaps an optimization that picks favored overloads is no longer firing after your PR. As a result, rather than trying and successfully solving using integer operations for the arithmetic and stopping there, we exponentially attempt all combinations of all overloads of those operators. It would be very interesting to understand why that is since based on the description I would not expect your PR to have an impact on that.</div><div class=""><br class=""></div><div class="">Mark</div><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Aug 9, 2017, at 11:22 AM, David Zarzycki via swift-dev <<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Any tips on how to debug performance regressions?<div class=""><br class=""></div><div class="">And as aside, if this test is critical enough to cause a revert, why isn’t it in the public repo?</div><div class=""><div class=""><br class=""></div></div></div></div></blockquote><div class=""><br class=""></div>This is part of a larger internal test.</div><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><div class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Aug 9, 2017, at 14:04, Arnold Schwaighofer <<a href="mailto:notifications@github.com" class="">notifications@github.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p class="">Hi Dave,<br class="">
I have reverted this commit because it broke internal bots.</p>
<pre class=""><code class="">import Foundation
class P {
var x : Int = 0
var y : Int = 1
}
let dist : (P, P) -> Double = {
(p : P, s : P) -> Double in
sqrt(Double((p.x-s.x)*(p.x-s.x) + (p.y-s.y)*(p.y-s.y)))
}
</code></pre><p class="">fails now with expression to complex.</p><p style="font-size:small;-webkit-text-size-adjust:none;color:#666;" class="">—<br class="">You are receiving this because you authored the thread.<br class="">Reply to this email directly, <a href="https://github.com/apple/swift/pull/11397#issuecomment-321334844" class="">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABBbbrS4O6QyW6_j4ksVB-fo2EPtmbWVks5sWfSigaJpZM4Oxfg-" class="">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABBbbpGHltnRTuyP1p8I4EpU_ZYh8rm2ks5sWfSigaJpZM4Oxfg-.gif" width="1" class=""></p>
<div itemscope="" itemtype="http://schema.org/EmailMessage" class="">
<div itemprop="action" itemscope="" itemtype="http://schema.org/ViewAction" class="">
<link itemprop="url" href="https://github.com/apple/swift/pull/11397#issuecomment-321334844" class="">
<meta itemprop="name" content="View Pull Request" class="">
</div>
<meta itemprop="description" content="View this Pull Request on GitHub" class="">
</div>
</div></blockquote></div><br class=""></div></div></div></div></div>_______________________________________________<br class="">swift-dev mailing list<br class=""><a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-dev" class="">https://lists.swift.org/mailman/listinfo/swift-dev</a><br class=""></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></body></html>