1
2
3
4
5 package field
6
7 import "testing"
8
9 func BenchmarkAdd(b *testing.B) {
10 var x, y Element
11 x.One()
12 y.Add(feOne, feOne)
13 b.ResetTimer()
14 for i := 0; i < b.N; i++ {
15 x.Add(&x, &y)
16 }
17 }
18
19 func BenchmarkMultiply(b *testing.B) {
20 var x, y Element
21 x.One()
22 y.Add(feOne, feOne)
23 b.ResetTimer()
24 for i := 0; i < b.N; i++ {
25 x.Multiply(&x, &y)
26 }
27 }
28
29 func BenchmarkMult32(b *testing.B) {
30 var x Element
31 x.One()
32 b.ResetTimer()
33 for i := 0; i < b.N; i++ {
34 x.Mult32(&x, 0xaa42aa42)
35 }
36 }
37
View as plain text