Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix benchmarks hit ratio display #128

Merged
merged 1 commit into from Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions 2q_test.go
Expand Up @@ -32,7 +32,7 @@ func Benchmark2Q_Rand(b *testing.B) {
}
}
}
b.Logf("hit: %d miss: %d ratio: %f", hit, miss, float64(hit)/float64(miss))
b.Logf("hit: %d miss: %d ratio: %f", hit, miss, float64(hit)/float64(hit+miss))
}

func Benchmark2Q_Freq(b *testing.B) {
Expand Down Expand Up @@ -63,7 +63,7 @@ func Benchmark2Q_Freq(b *testing.B) {
miss++
}
}
b.Logf("hit: %d miss: %d ratio: %f", hit, miss, float64(hit)/float64(miss))
b.Logf("hit: %d miss: %d ratio: %f", hit, miss, float64(hit)/float64(hit+miss))
}

func Test2Q_RandomOps(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions arc_test.go
Expand Up @@ -38,7 +38,7 @@ func BenchmarkARC_Rand(b *testing.B) {
}
}
}
b.Logf("hit: %d miss: %d ratio: %f", hit, miss, float64(hit)/float64(miss))
b.Logf("hit: %d miss: %d ratio: %f", hit, miss, float64(hit)/float64(hit+miss))
}

func BenchmarkARC_Freq(b *testing.B) {
Expand Down Expand Up @@ -69,7 +69,7 @@ func BenchmarkARC_Freq(b *testing.B) {
miss++
}
}
b.Logf("hit: %d miss: %d ratio: %f", hit, miss, float64(hit)/float64(miss))
b.Logf("hit: %d miss: %d ratio: %f", hit, miss, float64(hit)/float64(hit+miss))
}

func TestARC_RandomOps(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions lru_test.go
Expand Up @@ -32,7 +32,7 @@ func BenchmarkLRU_Rand(b *testing.B) {
}
}
}
b.Logf("hit: %d miss: %d ratio: %f", hit, miss, float64(hit)/float64(miss))
b.Logf("hit: %d miss: %d ratio: %f", hit, miss, float64(hit)/float64(hit+miss))
}

func BenchmarkLRU_Freq(b *testing.B) {
Expand Down Expand Up @@ -63,7 +63,7 @@ func BenchmarkLRU_Freq(b *testing.B) {
miss++
}
}
b.Logf("hit: %d miss: %d ratio: %f", hit, miss, float64(hit)/float64(miss))
b.Logf("hit: %d miss: %d ratio: %f", hit, miss, float64(hit)/float64(hit+miss))
}

func TestLRU(t *testing.T) {
Expand Down