The Secret Life of Go: sync.Map
The Secret Life of Go: sync.Map The Concurrent Map, Shard Optimizations, and When Not to Use It #Golang #Concurrency #BackendDev #SoftwareArchitecture Eleanor is a senior software engineer. Ethan is her junior colleague. They work in a beautiful beaux arts library in Lower Manhattan — the kind of place where coding languages are discussed like poetry. Episode 28: The Concurrent Map, Shard Optimizations, and When Not to Use It Ethan was staring at a CPU profile on his monitor, looking perplexed. "We upgraded the server to 32 cores," he told Eleanor as she walked by. "But the application isn't running any faster. In fact, the CPU profile shows that almost all the cores are just... waiting." Eleanor pulled up a chair and looked at the flame graph on his screen. It was dominated by a massive red block labeled sync.(*RWMutex).RLock . "Ah," she said. "You have discovered lock contention. Your cache from Episode 27 is a victim of its own success....