(b *testing.B)
| 120 | const nStrsBench = 1000 |
| 121 | |
| 122 | func BenchmarkUint32Store(b *testing.B) { |
| 123 | m := typicalCodeStrings(nStrsBench) |
| 124 | fm := faststringmap.NewUint32Store(m) |
| 125 | b.ResetTimer() |
| 126 | for bi := 0; bi < b.N; bi++ { |
| 127 | for si, n := uint32(0), uint32(len(m.in)); si < n; si++ { |
| 128 | v, ok := fm.LookupString(m.in[si]) |
| 129 | if !ok || v != si { |
| 130 | b.Fatalf("ok=%v, value got %d want %d", ok, v, si) |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | func BenchmarkGoStringToUint32(b *testing.B) { |
| 137 | m := typicalCodeStrings(nStrsBench) |
nothing calls this directly
no test coverage detected