Skip to content

Commit

Permalink
alg/ensemble: benchmark (#97)
Browse files Browse the repository at this point in the history
Updates #60
Updates #25
  • Loading branch information
mmcloughlin authored May 12, 2021
1 parent bf4bdfa commit 10bb4ec
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions alg/ensemble/ensemble_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package ensemble

import (
"testing"

"github.com/mmcloughlin/addchain/internal/results"
)

func BenchmarkResults(b *testing.B) {
as := Ensemble()
for _, c := range results.Results {
c := c // scopelint
n := c.Target()
b.Run(c.Slug, func(b *testing.B) {
for i := 0; i < b.N; i++ {
for _, a := range as {
if _, err := a.FindChain(n); err != nil {
b.Fatal(err)
}
}
}
})
}
}

0 comments on commit 10bb4ec

Please sign in to comment.