go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

singleflight--->sync.Map

Open todayforever opened this issue 1 year ago • 1 comments

//说明:sync.Map的原子操作,适用于读多很少,相比以前读写都使用mutex,性能会更好 //测试用例部分过不了,需要先执行fn() 函数获取val,,Kevin老师是否考虑使用sync.Map

todayforever avatar Jul 20 '22 07:07 todayforever

The scenarios on using singleflight are with IO operations, performance is not a problem here.

kevwan avatar Jul 21 '22 13:07 kevwan