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

Function BenchmarkCachedPriorityModel

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

Source from the content-addressed store, hash-verified

172}
173
174func BenchmarkCachedPriorityModel(b *testing.B) {
175 e, _ := NewCachedEnforcer("examples/priority_model.conf", "examples/priority_policy.csv")
176
177 b.ResetTimer()
178 for i := 0; i < b.N; i++ {
179 _, _ = e.Enforce("alice", "data1", "read")
180 }
181}
182
183func BenchmarkCachedWithEnforceContext(b *testing.B) {
184 e, _ := NewCachedEnforcer("examples/priority_model_enforce_context.conf", "examples/priority_policy_enforce_context.csv")

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…