3 ms·
> it turns out that maps slow down the Go garbage collector whereas slices collaborate much better with it. It should be noted here that this is not a problem w
by bediger4000 4y ago
> it turns out that maps slow down the Go garbage collector whereas slices collaborate much better with it. It should be noted here that this is not a problem with maps but a result of the way the Go garbage collector works.
I didn't think we can conclude this based on what the article presents. The stunt where the author assigns to "_" I think is supposed to prevent garbage collection of selected pieces of dynamically allocated memory, but I'm unconvinced: assignment to "_" is weird. The compiler clearly knows to do special things with "_". Why should we believe this prevents GC? I think there's other problems with these micro benchmarks, too.