On Tue, May 30, 2017 at 12:44 PM, Jan Ziak <0xe2.0x9a.0...@gmail.com> wrote:
> 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> 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.

That is a good point.  Go's current GC is clearly doing extra work,
but it's doing it in parallel with other work, so on a system with
spare CPU capacity Go is making a reasonable choice.  But see
https://golang.org/issue/17969 .

Ian

-- 
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