MCPcopy
hub / github.com/gofiber/fiber / BenchmarkState_Reset

Function BenchmarkState_Reset

state_test.go:994–1005  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

992}
993
994func BenchmarkState_Reset(b *testing.B) {
995 b.ReportAllocs()
996
997 for b.Loop() {
998 st := newState()
999 // add a fixed number of keys before clearing
1000 for j := range 100 {
1001 st.Set("key"+strconv.Itoa(j), j)
1002 }
1003 st.Reset()
1004 }
1005}
1006
1007func BenchmarkState_Keys(b *testing.B) {
1008 b.ReportAllocs()

Callers

nothing calls this directly

Calls 3

newStateFunction · 0.85
SetMethod · 0.65
ResetMethod · 0.65

Tested by

no test coverage detected