On Tue, Jul 27, 2021 at 4:56 AM rmfr <remus.clearwa...@gmail.com> wrote: > > Hi, I'm reading the GC implementation of Golang, and some questions have come > to me. As the title described: > > Proposition 1: > The time cost of the mark phase in GC is mainly depending on the amount > of the living objects. > > Proposition 2: > The time cost of the mark phase in GC has very little to do with the > amount of unused objects. > > Do both propositions above is true? Thanks a lot.
Yes, both statements are generally true. That said, since Go's garbage collector runs concurrently with the rest of the program, it's a little hard to know what "the time cost of the mark phase" is. But it is true that in general during marking the GC only looks at live objects. 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXLy%3D2%2B2NML_9tDDqF%3Dm1MnPfVcZ128iN8Pm4-_KepHKw%40mail.gmail.com.