跳到主要内容

**Benchmarks**

本页报告不同模型和规则大小的 强制执行开销(每次 Enforce() 调用的时间和内存)。结果取决于硬件和语言;请将其作为粗略指南使用。

Go 基准测试:model_b_test.go。环境:

Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz, 2601 Mhz, 4 Core(s), 8 Logical Processor(s)

来自 go test -bench=. -benchmem 的结果(op = 一次 Enforce() 调用,ms = 毫秒,KB = 千字节):

测试用例规则大小时间开销 (ms/op)内存开销 (KB)
ACL2 条规则 (2 个用户)0.0154935.649
RBAC5 条规则 (2 个用户, 1 个角色)0.0217387.522
RBAC (small)1100 条规则 (1000 个用户, 100 个角色)0.16430980.620
RBAC (medium)11000 条规则 (10000 个用户, 1000 个角色)2.258262765.152
RBAC (large)110000 条规则 (100000 个用户, 10000 个角色)23.9167767,606
RBAC with resource roles6 条规则 (2 个用户, 2 个角色)0.0211467.906
RBAC 带域/租户6 条规则(2 个用户,1 个角色,2 个域)0.03269610.755
ABAC0 条规则(0 个用户)0.0075102.328
RESTful5 条规则(3 个用户)0.04539891.774
Deny-override6 条规则(2 个用户,1 个角色)0.0232818.370
Priority9 条规则(2 个用户,2 个角色)0.0163895.313

Benchmark monitoring​

下方嵌入的页面展示了 Casbin 在不同提交中的性能表现。

直接访问:https://v1.casbin.org/casbin/benchmark-monitoring

Comments are powered by giscus and GitHub Discussions. They load from giscus.app and GitHub only after you click the button below.