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

Function BenchmarkCachedABACModel

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

Source from the content-addressed store, hash-verified

144}
145
146func BenchmarkCachedABACModel(b *testing.B) {
147 e, _ := NewCachedEnforcer("examples/abac_model.conf")
148 data1 := newTestResource("data1", "alice")
149
150 b.ResetTimer()
151 for i := 0; i < b.N; i++ {
152 _, _ = e.Enforce("alice", data1, "read")
153 }
154}
155
156func BenchmarkCachedKeyMatchModel(b *testing.B) {
157 e, _ := NewCachedEnforcer("examples/keymatch_model.conf", "examples/keymatch_policy.csv")

Callers

nothing calls this directly

Calls 3

EnforceMethod · 0.95
NewCachedEnforcerFunction · 0.85
newTestResourceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…