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

Function BenchmarkBasicModel

model_b_test.go:40–47  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

38}
39
40func BenchmarkBasicModel(b *testing.B) {
41 e, _ := NewEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")
42
43 b.ResetTimer()
44 for i := 0; i < b.N; i++ {
45 _, _ = e.Enforce("alice", "data1", "read")
46 }
47}
48
49func BenchmarkRBACModel(b *testing.B) {
50 e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv")

Callers

nothing calls this directly

Calls 2

EnforceMethod · 0.95
NewEnforcerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…