Commit 818d2b6e authored by Thomas Hoffmann's avatar Thomas Hoffmann
Browse files

Extra benchmarks

parent 2384e917
......@@ -91,7 +91,7 @@ func MaxSubset(t int, superset []BallotList) map[string]bool {
if len(subsets[i]) > max {
max = i
}
if len(subsets[i]) == best {
if len(subsets[i]) == best+1 {
break
}
}
......
......@@ -122,6 +122,7 @@ func benchmarkTally(votecount, serverCount, reqServer int, b *testing.B) {
func BenchmarkTallyVote(b *testing.B) {
log.SetOutput(ioutil.Discard)
b.Run("1 Votes", func(b *testing.B) { benchmarkTally(1, 5, 3, b) })
b.Run("10 Votes", func(b *testing.B) { benchmarkTally(10, 5, 3, b) })
b.Run("100 Votes", func(b *testing.B) { benchmarkTally(100, 5, 3, b) })
b.Run("1000 Votes", func(b *testing.B) { benchmarkTally(1000, 5, 3, b) })
......@@ -130,27 +131,37 @@ func BenchmarkTallyVote(b *testing.B) {
}
func BenchmarkTallyServer(b *testing.B) {
log.SetOutput(ioutil.Discard)
b.Run("9 of 9 servers", func(b *testing.B) { benchmarkTally(100, 9, 9, b) })
b.Run("9 of 10 servers", func(b *testing.B) { benchmarkTally(100, 10, 9, b) })
b.Run("9 of 11 servers", func(b *testing.B) { benchmarkTally(100, 11, 9, b) })
b.Run("9 of 12 servers", func(b *testing.B) { benchmarkTally(100, 12, 9, b) })
b.Run("9 of 13 servers", func(b *testing.B) { benchmarkTally(100, 13, 9, b) })
b.Run("9 of 14 servers", func(b *testing.B) { benchmarkTally(100, 14, 9, b) })
b.Run("9 of 15 servers", func(b *testing.B) { benchmarkTally(100, 15, 9, b) })
b.Run("9 of 16 servers", func(b *testing.B) { benchmarkTally(100, 16, 9, b) })
b.Run("9 of 17 servers", func(b *testing.B) { benchmarkTally(100, 17, 9, b) })
b.Run("9 of 9 servers", func(b *testing.B) { benchmarkTally(10, 9, 9, b) })
b.Run("9 of 10 servers", func(b *testing.B) { benchmarkTally(10, 10, 9, b) })
b.Run("9 of 11 servers", func(b *testing.B) { benchmarkTally(10, 11, 9, b) })
b.Run("9 of 12 servers", func(b *testing.B) { benchmarkTally(10, 12, 9, b) })
b.Run("9 of 13 servers", func(b *testing.B) { benchmarkTally(10, 13, 9, b) })
b.Run("9 of 14 servers", func(b *testing.B) { benchmarkTally(10, 14, 9, b) })
b.Run("9 of 15 servers", func(b *testing.B) { benchmarkTally(10, 15, 9, b) })
b.Run("9 of 16 servers", func(b *testing.B) { benchmarkTally(10, 16, 9, b) })
b.Run("9 of 17 servers", func(b *testing.B) { benchmarkTally(10, 17, 9, b) })
}
func BenchmarkTallyThreshold(b *testing.B) {
log.SetOutput(ioutil.Discard)
b.Run("9 of 17 servers", func(b *testing.B) { benchmarkTally(100, 17, 9, b) })
b.Run("10 of 17 servers", func(b *testing.B) { benchmarkTally(100, 17, 10, b) })
b.Run("11 of 17 servers", func(b *testing.B) { benchmarkTally(100, 17, 11, b) })
b.Run("12 of 17 servers", func(b *testing.B) { benchmarkTally(100, 17, 12, b) })
b.Run("13 of 17 servers", func(b *testing.B) { benchmarkTally(100, 17, 13, b) })
b.Run("14 of 17 servers", func(b *testing.B) { benchmarkTally(100, 17, 14, b) })
b.Run("15 of 17 servers", func(b *testing.B) { benchmarkTally(100, 17, 15, b) })
b.Run("16 of 17 servers", func(b *testing.B) { benchmarkTally(100, 17, 16, b) })
b.Run("17 of 17 servers", func(b *testing.B) { benchmarkTally(100, 17, 17, b) })
b.Run("9 of 17 servers", func(b *testing.B) { benchmarkTally(10, 17, 9, b) })
b.Run("10 of 17 servers", func(b *testing.B) { benchmarkTally(10, 17, 10, b) })
b.Run("11 of 17 servers", func(b *testing.B) { benchmarkTally(10, 17, 11, b) })
b.Run("12 of 17 servers", func(b *testing.B) { benchmarkTally(10, 17, 12, b) })
b.Run("13 of 17 servers", func(b *testing.B) { benchmarkTally(10, 17, 13, b) })
b.Run("14 of 17 servers", func(b *testing.B) { benchmarkTally(10, 17, 14, b) })
b.Run("15 of 17 servers", func(b *testing.B) { benchmarkTally(10, 17, 15, b) })
b.Run("16 of 17 servers", func(b *testing.B) { benchmarkTally(10, 17, 16, b) })
b.Run("17 of 17 servers", func(b *testing.B) { benchmarkTally(10, 17, 17, b) })
}
func BenchmarkTallyOptimal(b *testing.B) {
log.SetOutput(ioutil.Discard)
b.Run("5 of 9 servers", func(b *testing.B) { benchmarkTally(10, 9, 5, b) })
b.Run("6 of 11 servers", func(b *testing.B) { benchmarkTally(10, 11, 6, b) })
b.Run("7 of 13 servers", func(b *testing.B) { benchmarkTally(10, 13, 7, b) })
b.Run("8 of 15 servers", func(b *testing.B) { benchmarkTally(10, 15, 8, b) })
b.Run("9 of 17 servers", func(b *testing.B) { benchmarkTally(10, 17, 9, b) })
b.Run("10 of 19 servers", func(b *testing.B) { benchmarkTally(10, 19, 10, b) })
b.Run("11 of 21 servers", func(b *testing.B) { benchmarkTally(10, 21, 11, b) })
}
///////////////////////////////
......@@ -210,33 +221,33 @@ func BenchmarkCombineVote(b *testing.B) {
}
func BenchmarkCombineServer(b *testing.B) {
log.SetOutput(ioutil.Discard)
b.Run("15 of 15 servers", func(b *testing.B) { benchmarkCombine(100, 15, 15, b) })
b.Run("15 of 16 servers", func(b *testing.B) { benchmarkCombine(100, 16, 15, b) })
b.Run("15 of 17 servers", func(b *testing.B) { benchmarkCombine(100, 17, 15, b) })
b.Run("15 of 18 servers", func(b *testing.B) { benchmarkCombine(100, 18, 15, b) })
b.Run("15 of 19 servers", func(b *testing.B) { benchmarkCombine(100, 19, 15, b) })
b.Run("15 of 20 servers", func(b *testing.B) { benchmarkCombine(100, 20, 15, b) })
b.Run("15 of 21 servers", func(b *testing.B) { benchmarkCombine(100, 21, 15, b) })
b.Run("15 of 22 servers", func(b *testing.B) { benchmarkCombine(100, 22, 15, b) })
b.Run("15 of 23 servers", func(b *testing.B) { benchmarkCombine(100, 23, 15, b) })
b.Run("15 of 24 servers", func(b *testing.B) { benchmarkCombine(100, 24, 15, b) })
b.Run("15 of 25 servers", func(b *testing.B) { benchmarkCombine(100, 25, 15, b) })
b.Run("15 of 26 servers", func(b *testing.B) { benchmarkCombine(100, 26, 15, b) })
b.Run("15 of 27 servers", func(b *testing.B) { benchmarkCombine(100, 27, 15, b) })
b.Run("15 of 28 servers", func(b *testing.B) { benchmarkCombine(100, 28, 15, b) })
b.Run("15 of 29 servers", func(b *testing.B) { benchmarkCombine(100, 29, 15, b) })
b.Run("15 of 15 servers", func(b *testing.B) { benchmarkCombine(10, 15, 15, b) })
b.Run("15 of 16 servers", func(b *testing.B) { benchmarkCombine(10, 16, 15, b) })
b.Run("15 of 17 servers", func(b *testing.B) { benchmarkCombine(10, 17, 15, b) })
b.Run("15 of 18 servers", func(b *testing.B) { benchmarkCombine(10, 18, 15, b) })
b.Run("15 of 19 servers", func(b *testing.B) { benchmarkCombine(10, 19, 15, b) })
b.Run("15 of 20 servers", func(b *testing.B) { benchmarkCombine(10, 20, 15, b) })
b.Run("15 of 21 servers", func(b *testing.B) { benchmarkCombine(10, 21, 15, b) })
b.Run("15 of 22 servers", func(b *testing.B) { benchmarkCombine(10, 22, 15, b) })
b.Run("15 of 23 servers", func(b *testing.B) { benchmarkCombine(10, 23, 15, b) })
b.Run("15 of 24 servers", func(b *testing.B) { benchmarkCombine(10, 24, 15, b) })
b.Run("15 of 25 servers", func(b *testing.B) { benchmarkCombine(10, 25, 15, b) })
b.Run("15 of 26 servers", func(b *testing.B) { benchmarkCombine(10, 26, 15, b) })
b.Run("15 of 27 servers", func(b *testing.B) { benchmarkCombine(10, 27, 15, b) })
b.Run("15 of 28 servers", func(b *testing.B) { benchmarkCombine(10, 28, 15, b) })
b.Run("15 of 29 servers", func(b *testing.B) { benchmarkCombine(10, 29, 15, b) })
}
func BenchmarkCombineThreshold(b *testing.B) {
log.SetOutput(ioutil.Discard)
b.Run("9 of 17 servers", func(b *testing.B) { benchmarkCombine(100, 17, 9, b) })
b.Run("10 of 17 servers", func(b *testing.B) { benchmarkCombine(100, 17, 10, b) })
b.Run("11 of 17 servers", func(b *testing.B) { benchmarkCombine(100, 17, 11, b) })
b.Run("12 of 17 servers", func(b *testing.B) { benchmarkCombine(100, 17, 12, b) })
b.Run("13 of 17 servers", func(b *testing.B) { benchmarkCombine(100, 17, 13, b) })
b.Run("14 of 17 servers", func(b *testing.B) { benchmarkCombine(100, 17, 14, b) })
b.Run("15 of 17 servers", func(b *testing.B) { benchmarkCombine(100, 17, 15, b) })
b.Run("16 of 17 servers", func(b *testing.B) { benchmarkCombine(100, 17, 16, b) })
b.Run("17 of 17 servers", func(b *testing.B) { benchmarkCombine(100, 17, 17, b) })
b.Run("9 of 17 servers", func(b *testing.B) { benchmarkCombine(10, 17, 9, b) })
b.Run("10 of 17 servers", func(b *testing.B) { benchmarkCombine(10, 17, 10, b) })
b.Run("11 of 17 servers", func(b *testing.B) { benchmarkCombine(10, 17, 11, b) })
b.Run("12 of 17 servers", func(b *testing.B) { benchmarkCombine(10, 17, 12, b) })
b.Run("13 of 17 servers", func(b *testing.B) { benchmarkCombine(10, 17, 13, b) })
b.Run("14 of 17 servers", func(b *testing.B) { benchmarkCombine(10, 17, 14, b) })
b.Run("15 of 17 servers", func(b *testing.B) { benchmarkCombine(10, 17, 15, b) })
b.Run("16 of 17 servers", func(b *testing.B) { benchmarkCombine(10, 17, 16, b) })
b.Run("17 of 17 servers", func(b *testing.B) { benchmarkCombine(10, 17, 17, b) })
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment