3 ms·
> During a garbage collection, the runtime scans objects containing pointers, and chases them. If you have a very large map[string]int, the GC has to check ever
by pcwalton 7y ago
> During a garbage collection, the runtime scans objects containing pointers, and chases them. If you have a very large map[string]int, the GC has to check every string within the map, every GC, as strings contain pointers.
This would, of course, be much less of an issue with a generational GC, which doesn't have to scan the entire heap on every collection.