MCPcopy Index your code
hub / github.com/apache/casbin / BenchmarkCachedBasicModel

Function BenchmarkCachedBasicModel

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

Source from the content-addressed store, hash-verified

26}
27
28func BenchmarkCachedBasicModel(b *testing.B) {
29 e, _ := NewCachedEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")
30
31 b.ResetTimer()
32 for i := 0; i < b.N; i++ {
33 _, _ = e.Enforce("alice", "data1", "read")
34 }
35}
36
37func BenchmarkCachedRBACModel(b *testing.B) {
38 e, _ := NewCachedEnforcer("examples/rbac_model.conf", "examples/rbac_policy.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…