MCPcopy Create free account
hub / github.com/devfeel/dotweb / BenchmarkRuntimeStore_SessionRead_1

Function BenchmarkRuntimeStore_SessionRead_1

session/store_runtime_test.go:191–201  ·  view source on GitHub ↗

** 性能测试 | 基准测试 */

(b *testing.B)

Source from the content-addressed store, hash-verified

189*/
190
191func BenchmarkRuntimeStore_SessionRead_1(b *testing.B) {
192 testStore := NewRuntimeStore(NewDefaultRuntimeConfig())
193 testValue := make(map[interface{}]interface{})
194 testValue["foo"] = "bar"
195 testStore.SessionUpdate(NewSessionState(testStore, "session_read", testValue))
196
197 for i := 0; i < b.N; i++ {
198 testStore.SessionRead("session_read")
199 }
200 b.ReportAllocs()
201}
202
203func BenchmarkRuntimeStore_SessionRead_Parallel(b *testing.B) {
204 testStore := NewRuntimeStore(NewDefaultRuntimeConfig())

Callers

nothing calls this directly

Calls 5

SessionUpdateMethod · 0.95
SessionReadMethod · 0.95
NewRuntimeStoreFunction · 0.85
NewDefaultRuntimeConfigFunction · 0.85
NewSessionStateFunction · 0.85

Tested by

no test coverage detected