mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2026-02-17 10:35:43 +08:00
实现新的计数器算法(将时间分片, 统计更加精准)
This commit is contained in:
@@ -213,7 +213,7 @@ func BenchmarkCache_Add_Parallel(b *testing.B) {
|
||||
b.RunParallel(func(pb *testing.PB) {
|
||||
for pb.Next() {
|
||||
var j = atomic.AddInt64(&i, 1)
|
||||
cache.Write(types.String(j), j, fasttime.Now().Unix()+i%1024)
|
||||
cache.Write(types.String(j%1e6), j, fasttime.Now().Unix()+i%1024)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user