MCPcopy Create free account
hub / github.com/evilsocket/sum / wrappedRecordDotN

Function wrappedRecordDotN

wrapper/record_benchmark_test.go:65–80  ·  view source on GitHub ↗
(b *testing.B, N int)

Source from the content-addressed store, hash-verified

63}
64
65func wrappedRecordDotN(b *testing.B, N int) {
66 a := pb.Record{Data: make([]float32, N)}
67 c := pb.Record{Data: make([]float32, N)}
68 for i := 0; i < N; i++ {
69 a.Data[i] = rand.Float32()
70 c.Data[i] = rand.Float32()
71 }
72
73 wa := WrapRecord(&a)
74 wc := WrapRecord(&c)
75
76 b.ResetTimer()
77 for i := 0; i < b.N; i++ {
78 _ = wa.Dot(wc)
79 }
80}
81
82func BenchmarkWrappedRecordDot10(b *testing.B) {
83 wrappedRecordDotN(b, 10)

Calls 2

WrapRecordFunction · 0.85
DotMethod · 0.65

Tested by

no test coverage detected