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

Function BenchmarkWrappedRecordMagnitude

wrapper/record_benchmark_test.go:98–108  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

96}
97
98func BenchmarkWrappedRecordMagnitude(b *testing.B) {
99 testRecord.Data = []float32{0, 0, 2}
100 shouldBe := 2.0
101 a := WrapRecord(&testRecord)
102
103 for i := 0; i < b.N; i++ {
104 if mag := a.Magnitude(); mag != shouldBe {
105 b.Fatalf("magnitude should be %f, got %f", shouldBe, mag)
106 }
107 }
108}
109
110func BenchmarkWrappedRecordCosine(b *testing.B) {
111 testRecord.Data = []float32{3, 6, 9}

Callers

nothing calls this directly

Calls 2

WrapRecordFunction · 0.85
MagnitudeMethod · 0.80

Tested by

no test coverage detected