mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 04:00:25 +03:00
re-use rand.New() do not repeat allocate. (#13448)
also simplify readerLocks to be just like writeLocks, DRWMutex() is never shared and there are order guarantees that need for such a thing to work for RLock's
This commit is contained in:
@@ -306,6 +306,9 @@ func TestRUnlockPanic2(t *testing.T) {
|
||||
|
||||
// Borrowed from rwmutex_test.go
|
||||
func benchmarkRWMutex(b *testing.B, localWork, writeRatio int) {
|
||||
b.ResetTimer()
|
||||
b.ReportAllocs()
|
||||
|
||||
rwm := NewDRWMutex(ds, "test")
|
||||
b.RunParallel(func(pb *testing.PB) {
|
||||
foo := 0
|
||||
|
||||
Reference in New Issue
Block a user