<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 10, 2017, at 3:05 PM, Joe Groff &lt;<a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">On Nov 8, 2017, at 9:59 PM, Erik Eckstein via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:<br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On Nov 8, 2017, at 5:27 PM, Johannes Weiß via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:<br class=""><br class="">Hi Daniel,<br class=""><br class=""><blockquote type="cite" class="">On 2 Nov 2017, at 8:15 pm, Daniel Dunbar &lt;<a href="mailto:daniel_dunbar@apple.com" class="">daniel_dunbar@apple.com</a>&gt; wrote:<br class=""><br class="">My personal preference is to:<br class="">1. Do nothing for now, but encourage publishing standardized protocols to solve this need.<br class="">2. Hope for a future with WMO+LTO magic which recovers the performance, for the case where the entire application ends up using one implementation.<br class=""></blockquote><br class="">Hmm, but that'll only work if we get 'whole product optimisation', right?<br class=""></blockquote><br class="">yes.<br class=""><br class="">Even when we have cross-module optimizations (which would be comparable to thin-lto) we could not do that optimization.<br class=""><br class=""><blockquote type="cite" class="">If we still compile one module at the time I don't think the compiler will be able to figure out that there's just one implementation of that protocol in the whole program.<br class=""></blockquote><br class="">exactly<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">If you know you're building for an executable target, then it should be theoretically possible to look at the whole system and see that there's a single conformance to a protocol. For the situation Johannes is talking about, maybe this could be information that the build system feeds the compiler, so in a configuration file somewhere you'd say "I want to specialize all uses of the Logger.Logger protocol for the FancyLogger.FancyLogger&lt;MyOutputStream&gt; implementation" instead of relying on the compiler magically deriving it.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>Actually, speculative-devirtualization of protocol methods + cross-module optimization should be able to handle this. The only drawback is code size, which is fortunately not so important for that project.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">-Joe</span></div></blockquote></div><br class=""></body></html>