Both sync.Map and cowmap use atomic.Value atomic operations to access the map during data reading, resulting in similar read performance. However, sync.Map has better write performance. Therefore, cowmap directly utilizes sync.Map as its internal structure.

This commit is contained in:
werben
2023-08-10 14:20:17 +08:00
parent b8351ed483
commit 83140225ed

View File

@@ -11,8 +11,6 @@ import (
func Test_NewCowMap(t *testing.T) {
m := NewCowMap()
assert.NotNil(t, m)
assert.NotNil(t, m.readable)
}
}
func Test_CowMapLoad(t *testing.T) {