Seems like you were hitting: runtime: Large maps cause significant GC pauses #9477 [0] Looks like this issue was resolved for maps that don't contain pointers by [1]. From the article, sounds like the map keys were strings (which do contain pointers, so the map would need to be scanned by the GC). If pointers in the map keys and values could be avoided, it would have (if my understanding is correct) removed the need…
Ok but in rust those pointers can just be borrowed obviating the need for gc at all.
There would be no need for a GC to traverse the entire map, but that's because rust doesn't use a GC.