From f8804d42659022b441dde3bec07dbd921d17fcfe Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Mon, 4 May 2015 21:41:57 +0200 Subject: [PATCH] chunker: Add benchmark for reducibility test --- chunker/polynomials_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/chunker/polynomials_test.go b/chunker/polynomials_test.go index 1fce6fd7d..edea1124e 100644 --- a/chunker/polynomials_test.go +++ b/chunker/polynomials_test.go @@ -276,6 +276,22 @@ func TestPolIrreducible(t *testing.T) { } } +func BenchmarkPolIrreducible(b *testing.B) { + // find first irreducible polynomial + var pol chunker.Pol + for _, test := range polIrredTests { + if test.irred { + pol = test.f + break + } + } + + for i := 0; i < b.N; i++ { + Assert(b, pol.Irreducible(), + "Irreducibility test for Polynomial %v failed", pol) + } +} + var polGCDTests = []struct { f1 chunker.Pol f2 chunker.Pol