<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 17, 2016, at 11:13 AM, Brian Gesiak 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=""><div dir="ltr" class="">Hello all!<div class=""><br class=""></div><div class="">I really enjoyed Chris Lattner's slides from his talk at IBM &lt;<a href="http://researcher.watson.ibm.com/researcher/files/us-lmandel/lattner.pdf" class="">http://researcher.watson.ibm.com/researcher/files/us-lmandel/lattner.pdf</a>&gt;.&nbsp;</div><div class=""><br class=""></div><div class="">The speaker notes mention ARC:</div><div class=""><br class=""></div><div class="">"There are two principle downsides to ARC that people cite: one is the need for atomic increment/decrements, which can be slow." [...] "The performance problems it can cause are real in some important cases"</div><div class=""><br class=""></div><div class="">Can someone point me to a good resource that explains these problems? I guess atomic reference count changes create overhead in multithreaded applications? Are there more detailed explorations into this topic?</div></div></div></blockquote><div><br class=""></div><div>With a proper concurrency model, I believe you can make most reference counting operations local (my opinion). I have done some explorations in this area in the past using what I call thread local vs global reference counts and using marked concurrency boundaries to mediate transitions in between them (moving from thread local -&gt; atomic of course if one escapes in an undefined way).</div><div><br class=""></div><div>If you are interested in the perf difference with ARC atomics, Roman recently added a mode to the compiler called -assume-single-threaded that uses non-atomic reference counts anywhere.</div><div><br class=""></div><div>There are some interesting optimizations in this area as well, specifically even today, COW gives a nice guarantee of thread localness allowing you to eliminate atomic reference counts once you have a uniqued cow data structure.</div><div><br class=""></div><div>Michael</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Thanks!</div><div class=""><br class=""></div><div class="">- Brian Gesiak</div><div class=""><br class=""></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=""></body></html>