MCPcopy Create free account
hub / github.com/cantabular/faststringmap / BenchmarkGoStringToUint32

Function BenchmarkGoStringToUint32

uint32_store_test.go:136–147  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

134}
135
136func BenchmarkGoStringToUint32(b *testing.B) {
137 m := typicalCodeStrings(nStrsBench)
138 b.ResetTimer()
139 for bi := 0; bi < b.N; bi++ {
140 for si, n := uint32(0), uint32(len(m.in)); si < n; si++ {
141 v, ok := m.m[m.in[si]]
142 if !ok || v != si {
143 b.Fatalf("ok=%v, value got %d want %d", ok, v, si)
144 }
145 }
146 }
147}

Callers

nothing calls this directly

Calls 1

typicalCodeStringsFunction · 0.85

Tested by

no test coverage detected