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

Function BenchmarkWrappedRecordGet

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

Source from the content-addressed store, hash-verified

28}
29
30func BenchmarkWrappedRecordGet(b *testing.B) {
31 r := WrapRecord(&testRecord)
32 idx := 0
33 v := testRecord.Data[idx]
34
35 for i := 0; i < b.N; i++ {
36 if r.Get(idx) != v {
37 b.Fatalf("expected value %f at index %d, got %f", v, idx, r.Get(idx))
38 }
39 }
40}
41
42func BenchmarkWrappedRecordMeta(b *testing.B) {
43 r := WrapRecord(&testRecord)

Callers

nothing calls this directly

Calls 2

WrapRecordFunction · 0.85
GetMethod · 0.45

Tested by

no test coverage detected