(b *testing.B)
| 870 | } |
| 871 | |
| 872 | func BenchmarkState_GetFloat64(b *testing.B) { |
| 873 | b.ReportAllocs() |
| 874 | |
| 875 | st := newState() |
| 876 | n := 1000 |
| 877 | // prepopulate the state |
| 878 | for i := range n { |
| 879 | key := "key" + strconv.Itoa(i) |
| 880 | st.Set(key, float64(i)) |
| 881 | } |
| 882 | |
| 883 | i := 0 |
| 884 | for b.Loop() { |
| 885 | i++ |
| 886 | key := "key" + strconv.Itoa(i%n) |
| 887 | st.GetFloat64(key) |
| 888 | } |
| 889 | } |
| 890 | |
| 891 | func BenchmarkState_MustGet(b *testing.B) { |
| 892 | b.ReportAllocs() |
nothing calls this directly
no test coverage detected