-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e972379
commit afcdbd3
Showing
4 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package bcache | ||
|
||
import "sync" | ||
|
||
type BCache struct { | ||
} | ||
|
||
type bucket struct { | ||
l sync.Mutex | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package sync2_test | ||
|
||
import ( | ||
"sync" | ||
"testing" | ||
) | ||
|
||
func BenchmarkSyncMutexLockUnlock(b *testing.B) { | ||
m := &sync.Mutex{} | ||
b.SetBytes(1) | ||
b.RunParallel(func(p *testing.PB) { | ||
for p.Next() { | ||
m.Lock() | ||
m.Unlock() | ||
} | ||
}) | ||
} | ||
|
||
func BenchmarkSyncRWMutexLockUnlock(b *testing.B) { | ||
m := &sync.RWMutex{} | ||
b.SetBytes(1) | ||
b.RunParallel(func(p *testing.PB) { | ||
for p.Next() { | ||
m.Lock() | ||
m.Unlock() | ||
} | ||
}) | ||
} | ||
|
||
func BenchmarkSyncRWMutexRLockRUnlock(b *testing.B) { | ||
m := &sync.RWMutex{} | ||
b.SetBytes(1) | ||
b.RunParallel(func(p *testing.PB) { | ||
for p.Next() { | ||
m.RLock() | ||
m.RUnlock() | ||
} | ||
}) | ||
} |
Submodule wyhash-js
deleted from
8531e3