Permalink
Browse files

added logs

  • Loading branch information...
1 parent bfb8496 commit 2edc8bb0ff0b93303cc93542960a2925d474db73 @tux21b committed May 12, 2012
Showing with 15 additions and 5 deletions.
  1. +1 −1 README
  2. +12 −0 bench.log
  3. +2 −4 lock_test.go
View
2 README
@@ -1,4 +1,4 @@
-The goco package just contains some experiments with some concurrent
+The goco package just contains some experiments with concurrent
datastructures implemented in Go.
Run the benchmarks with:
View
12 bench.log
@@ -0,0 +1,12 @@
+PASS
+BenchmarkTASLock 500000000 18.8 ns/op
+BenchmarkTASLock-2 50000000 124 ns/op
+BenchmarkTASLock-4 20000000 518 ns/op
+BenchmarkTASLock-8 5000000 2462 ns/op
+BenchmarkTASLock-16 1000000 8738 ns/op
+BenchmarkTTASLock 500000000 25.0 ns/op
+BenchmarkTTASLock-2 100000000 308 ns/op
+BenchmarkTTASLock-4 20000000 692 ns/op
+BenchmarkTTASLock-8 10000000 3136 ns/op
+BenchmarkTTASLock-16 1000000 9685 ns/op
+ok github.com/tux21b/goco 154.396s
View
6 lock_test.go
@@ -11,14 +11,13 @@ import (
func BenchmarkTASLock(b *testing.B) {
procs := runtime.GOMAXPROCS(-1)
- n := b.N / procs
lock := new(TASLock)
wg := new(sync.WaitGroup)
wg.Add(procs)
for proc := 0; proc < procs; proc++ {
go func() {
runtime.LockOSThread()
- for i := 0; i < n; i++ {
+ for i := 0; i < b.N; i++ {
lock.Lock()
lock.Unlock()
}
@@ -30,14 +29,13 @@ func BenchmarkTASLock(b *testing.B) {
func BenchmarkTTASLock(b *testing.B) {
procs := runtime.GOMAXPROCS(-1)
- n := b.N / procs
lock := new(TTASLock)
wg := new(sync.WaitGroup)
wg.Add(procs)
for proc := 0; proc < procs; proc++ {
go func() {
runtime.LockOSThread()
- for i := 0; i < n; i++ {
+ for i := 0; i < b.N; i++ {
lock.Lock()
lock.Unlock()
}

0 comments on commit 2edc8bb

Please sign in to comment.