On Tuesday, May 16, 2017 at 4:06:25 PM UTC+2, Ian Lance Taylor wrote:
>
> On Tue, May 16, 2017 at 2:01 AM,  <canji...@qq.com <javascript:>> wrote: 
> > 
> > Generational and Compact gc have already been thought best practice. But 
> > golang doesn't adopt it. Who can tell me the reason? 
>
> Now let's consider a generational GC.  The point of a generational GC 
> relies on the generational hypothesis: that most values allocated in a 
> program are quickly unused, so there is an advantage for the GC to 
> spend more time looking at recently allocated objects.


>From a different angle/viewpoint, the point of a generational GC is to skip 
redundant work. Multiple runs of a non-generational GC might be performing 
repetitive work that can be avoided in the memory gets partitioned. It 
seems to me that looking at a generational GC from work redundancy 
viewpoint is slightly more general than the more commonly used generational 
hypothesis that most objects die young.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to