MCPcopy
hub / github.com/apache/casbin / BenchmarkCachedRBACModel

Function BenchmarkCachedRBACModel

enforcer_cached_b_test.go:37–44  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

35}
36
37func BenchmarkCachedRBACModel(b *testing.B) {
38 e, _ := NewCachedEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv")
39
40 b.ResetTimer()
41 for i := 0; i < b.N; i++ {
42 _, _ = e.Enforce("alice", "data2", "read")
43 }
44}
45
46func BenchmarkCachedRBACModelSmall(b *testing.B) {
47 e, _ := NewCachedEnforcer("examples/rbac_model.conf")

Callers

nothing calls this directly

Calls 2

EnforceMethod · 0.95
NewCachedEnforcerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…