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

Function BenchmarkHasLinkWithPatternLarge

role_manager_b_test.go:151–159  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

149}
150
151func BenchmarkHasLinkWithPatternLarge(b *testing.B) {
152 e, _ := NewEnforcer("examples/performance/rbac_with_pattern_large_scale_model.conf", "examples/performance/rbac_with_pattern_large_scale_policy.csv")
153 e.AddNamedMatchingFunc("g", "", util.KeyMatch4)
154 rm := e.rmMap["g"]
155 b.ResetTimer()
156 for i := 0; i < b.N; i++ {
157 _, _ = rm.HasLink("staffUser1001", "staff001", "/orgs/1/sites/site001")
158 }
159}
160
161func BenchmarkHasLinkWithDomainPatternLarge(b *testing.B) {
162 e, _ := NewEnforcer("examples/performance/rbac_with_pattern_large_scale_model.conf", "examples/performance/rbac_with_pattern_large_scale_policy.csv")

Callers

nothing calls this directly

Calls 3

AddNamedMatchingFuncMethod · 0.95
NewEnforcerFunction · 0.85
HasLinkMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…