<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=""><div class="">Ha, I remember this document, but forgot it included an implementation. Encouraging to see that it's pretty much identical.</div><div class=""><br class=""></div><div class="">The concrete type forwarding logic is something we ought to be able to simplify somehow (with new language features).</div><div class=""><br class=""></div><div class="">Jordan</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 9, 2016, at 9:50 , Nadav Rotem &lt;<a href="mailto:nrotem@apple.com" class="">nrotem@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">HI Jordan,&nbsp;</div><div class=""><br class=""></div><div class="">Very Nice! &nbsp; &nbsp;</div><div class=""><br class=""></div><div class="">There is a similar implementation and discussion about performance here:</div><div class=""><br class=""></div><a href="https://github.com/apple/swift/blob/master/docs/OptimizationTips.rst#advice-use-copy-on-write-semantics-for-large-values" class="">https://github.com/apple/swift/blob/master/docs/OptimizationTips.rst#advice-use-copy-on-write-semantics-for-large-values</a><div class=""><br class=""></div><div class="">-Nadav</div><div class=""><br class=""></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Mar 9, 2016, at 9:39 AM, Jordan Rose via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Just for fun, I wrote a wrapper for COW types that <i class="">don't</i>&nbsp;need the flexible inline storage of ManagedBuffer. It turned out to be pretty straightforward, though I didn't bother with materializeForSet and thus am incurring the cost of many extra value copies on mutation. The major downside is having to forward all operations through, something I'm sure the implementers of Array and Dictionary are very used to!<div class=""><br class=""></div><div class="">Disclaimer: <b class="">This is not performant; don't use it in your app.</b><br class=""><div class=""><br class=""></div><div class="">Jordan<br class=""><div class=""><br class=""></div><div class=""></div></div></div></div><span id="cid:7628D88D-C9C7-447E-92CC-25FA6052B6DC@apple.com" class="">&lt;cow.swift&gt;</span><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div class=""><div class=""><div class=""></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="">https://lists.swift.org/mailman/listinfo/swift-dev<br class=""></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></body></html>