优化缓存相关代码

This commit is contained in:
GoEdgeLab
2023-10-02 19:48:11 +08:00
parent d79c71e874
commit 414f0b873d
3 changed files with 13 additions and 9 deletions

View File

@@ -40,10 +40,14 @@ func TestNewCache(t *testing.T) {
}
func TestCache_Memory(t *testing.T) {
if !testutils.IsSingleTesting() {
return
}
testutils.StartMemoryStats(t)
var cache = NewCache()
var count = 2_000_000
var count = 20_000_000
for i := 0; i < count; i++ {
cache.Write("a"+strconv.Itoa(i), 1, time.Now().Unix()+3600)
}