Benchmarks
- Go
- Python
- C++
- Lua (JIT)
The overhead of policy enforcement has been benchmarked in model_b_test.go. The testbed configuration is as follows:
Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz, 2601 Mhz, 4 Core(s), 8 Logical Processor(s)
Following are the benchmarking results obtained by running go test -bench=. -benchmem
(op = an Enforce()
call, ms = millisecond, KB = kilobytes):
Испытательный регистр | Размер правила | Перекрытие времени (мс/оп) | Memory overhead (KB) |
---|---|---|---|
ACL | 2 правила (2 пользователя) | 0.015493 | 5.649 |
RBAC | 5 правил (2 пользователя, 1 роль) | 0.021738 | 7.522 |
RBAC (маленький) | 1100 правил (1000 пользователей, 100 ролей) | 0.164309 | 80.620 |
RBAC (средний) | 11000 правил (10000 пользователей, 1000 ролей) | 2.258262 | 765.152 |
RBAC (большой) | Правила 110000 (100000 пользователей, 10000 ролей) | 23.916776 | 7,606 |
RBAC с ролями ресурсов | 6 правил (2 пользователя, 2 роли) | 0.021146 | 7.906 |
RBAC с доменами/арендаторами | 6 правил (2 пользователя, 1 роль, 2 домена) | 0.032696 | 10.755 |
АДАТ | 0 правил (0 пользователь) | 0.007510 | 2.328 |
Восстановленный | 5 правил (3 пользователя) | 0.045398 | 91.774 |
Запретить переопределение | 6 правил (2 пользователя, 1 роль) | 0.023281 | 8.370 |
Приоритет | 9 правил (2 пользователя, 2 роли) | 0.016389 | 5.313 |
The overhead of policy enforcement in Pycasbin has been benchmarked in the tests/benchmarks
directory. The testbed configuration is as follows:
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz (Runned by Github actions)
platform linux -- Python 3.11.4, pytest-7.0.1, pluggy-1.2.0
Here are the benchmarking results obtained from executing casbin_benchmark
(op = an enforce()
call, ms = millisecond):
Испытательный регистр | Размер правила | Перекрытие времени (мс/оп) |
---|---|---|
ACL | 2 правила (2 пользователя) | 0.067691 |
RBAC | 5 правил (2 пользователя, 1 роль) | 0.080045 |
RBAC (маленький) | 1100 правил (1000 пользователей, 100 ролей) | 0.853590 |
RBAC (средний) | 11000 правил (10000 пользователей, 1000 ролей) | 6.986668 |
RBAC (большой) | Правила 110000 (100000 пользователей, 10000 ролей) | 77.922851 |
RBAC с ролями ресурсов | 6 правил (2 пользователя, 2 роли) | 0.106090 |
RBAC с доменами/арендаторами | 6 правил (2 пользователя, 1 роль, 2 домена) | 0.103628 |
АДАТ | 0 правил (0 пользователь) | 0.053213 |
Восстановленный | 5 правил (3 пользователя) | NA |
Запретить переопределение | 6 правил (2 пользователя, 1 роль) | NA |
Приоритет | 9 правил (2 пользователя, 2 роли) | 0.084684 |
The overhead of policy enforcement in Casbin CPP has been benchmarked in the tests/benchmarks
directory using Google's benchmarking tool. The testbed configuration is as follows:
Intel(R) Core(TM) i5-6300HQ CPU @ 2.30GHz, 4 ядра, 4 потока
Here are the benchmarking results obtained from executing the casbin_benchmark
target built in the Release
configuration (op = an enforce()
call, ms = millisecond):
Испытательный регистр | Размер правила | Перекрытие времени (мс/оп) |
---|---|---|
ACL | 2 правила (2 пользователя) | 0.0195 |
RBAC | 5 правил (2 пользователя, 1 роль) | 0.0288 |
RBAC (маленький) | 1100 правил (1000 пользователей, 100 ролей) | 0.300 |
RBAC (средний) | 11000 правил (10000 пользователей, 1000 ролей) | 2.113 |
RBAC (большой) | Правила 110000 (100000 пользователей, 10000 ролей) | 21.450 |
RBAC с ролями ресурсов | 6 правил (2 пользователя, 2 роли) | 0.03 |
RBAC с доменами/арендаторами | 6 правил (2 пользователя, 1 роль, 2 домена) | 0.041 |
АДАТ | 0 правил (0 пользователь) | NA |
Восстановленный | 5 правил (3 пользователя) | NA |
Запретить переопределение | 6 правил (2 пользователя, 1 роль) | 0.0246 |
Приоритет | 9 правил (2 пользователя, 2 роли) | 0.035 |
The overhead of policy enforcement in Lua Casbin has been benchmarked in bench.lua. The testbed configuration is as follows:
AMD Ryzen(TM) 5 4600H CPU @ 3.0GHz, 6 Cores, 12 потоков
Here are the benchmarking results obtained by running luajit bench.lua
(op = an enforce()
call, ms = millisecond):
Test case | Rule size | Time overhead (ms/op) |
---|---|---|
ACL | 2 rules (2 users) | 0.0533 |
RBAC | 5 rules (2 users, 1 role) | 0.0972 |
RBAC (small) | 1100 rules (1000 users, 100 roles) | 0.8598 |
RBAC (medium) | 11000 rules (10000 users, 1000 roles) | 8.6848 |
RBAC (large) | 110000 rules (100000 users, 10000 roles) | 90.3217 |
RBAC with resource roles | 6 rules (2 users, 2 roles) | 0.1124 |
RBAC with domains/tenants | 6 rules (2 users, 1 role, 2 domains) | 0.1978 |
ABAC | 0 rule (0 user) | 0.0305 |
RESTful | 5 rules (3 users) | 0.1085 |
Deny-override | 6 rules (2 users, 1 role) | 0.1934 |
Priority | 9 rules (2 users, 2 roles) | 0.1437 |
Benchmark monitoring
In the embedded web page below, you can see the performance changes of Casbin for each commit.
You can also directly browse it at: https://v1.casbin.org/casbin/benchmark-monitoring