<div class="gmail_quote"><font class="Apple-style-span" color="#3333ff">On Tue, Jul 5, 2011 at 9:00 PM, steffen <span dir="ltr">&lt;<a href="mailto:steffen.siering@googlemail.com">steffen.siering@googlemail.com</a>&gt;</span> wrote:<br>
</font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font class="Apple-style-span" color="#3333ff">The important point about reference counting on idevices is the near realtime performance, since stops for collecting garbage are actually very short in comparison to collecting compilers (despite more frequent). </font></blockquote>
<div><br></div><div>You can get near realtime performance from any collector if you structure your application to only need a fixed amount of memory. I.e. you can make guarantees about the amount of memory collected across any two GC cycles. </div>
<div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><font class="Apple-style-span" color="#006600">On Sat, Jul 2, 2011 at 16:51, Thomas Davie &lt;<a href="mailto:tom.davie@gmail.com">tom.davie@gmail.com</a>&gt; wrote:<br>
</font></span><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
<font class="Apple-style-span" color="#006600"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Apple recently announced a new static analysis in Clang called ARC (Automatic Reference Counting).  The idea is to provide what GC provides (zero memory management code by the programmer), but not to incur the runtime penalty of having to have the GC run.</span><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br>
</span><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">I was wondering if any of the compiler gurus out there could comment on the applicability of this kind of analysis to Haskell.  Dropping the GC and hence stopping it blocking all threads and killing parallel performance seems like nirvana.</span></font></blockquote>
</div><div><br></div><div>RC touches dead data, and GC touches live data. Look at the memory profile of a typical Haskell program - i.e. live memory ranging in megabytes, dead data ranging in hundreds of megabytes (if not gigabytes) per second. It is unlikely that we&#39;ll get much better performance from reference counting, though a hybrid model might be useful for the later generation (where collections are rarer). </div>
<div><br></div><div>I think Haskell could do a lot to improve its concurrent GC. At the moment, each processor has a space of its own that it can collect concurrently, plus there is global collection that freezes all threads and cleans up all garbage in the later generation. For very-large-memory apps, we could do a lot to extend concurrent GC into later generations, do a more effective job of either managing our own paging or integrating with OS virtual memory, and avoid the global collection as a last resort. Pauses with paging-aware collectors can be improved by over two orders of magnitude [1].</div>
<div><br></div><div>[1] <a href="http://lambda-the-ultimate.org/node/2391">Garbage Collection without Paging</a> </div><div><br></div><div><br></div></div>