Golang地图的性能影响是什么

In golang, maps implemented using hash tables .I am using locks of sync package for readinng and writing in maps. Is there any performance impact if 50,000 reqests try to access the map ? What is the order of reading/writing maps? Is it O(1)?

There are two separate issues here:

  1. What is the performance of a Go map?

An answer can be found in this issue

  1. What are the performance implication of 50,000 goroutines contending on a map.

This doesn't sound like a good idea, but you can never know without benchmarking. You might want to consider sending the map values asynchronously through a buffered channel, if you don't depend on the fact that the map value would be written immediately.

You might also want to check out concurrent-map which is solving a similar problem.