メインコンテンツにスキップ

Benchmarks

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, 2601Mhz, 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):

テストケースルールのサイズオーバーヘッド時間 (ms/op)Memory overhead (KB)
ACL2つのルール(2ユーザー)0.0154935.649
RBAC5つのルール(2ユーザー、1ロール)0.0217387.522
RBAC (小)1100 ルール (1000 ユーザー、100 ロール)0.16430980.620
RBAC (medium)11000ルール(10000ユーザー、1000ロール)2.258262765.152
RBAC (大)110000ルール(100000ユーザー、10000ロール)23.9167767,606
RBAC with resource roles6つのルール(2人のユーザー、2つのロール)0.0211467.906
ドメイン/テナントとRBAC6 ルール (2 ユーザー, 1 ロール, 2 ドメイン)0.03269610.755
ABAC0 ルール (0 ユーザー)0.0075102.328
RESTful5 ルール (3 ユーザー)0.04539891.774
無効にする6つのルール(2ユーザー、1ロール)0.0232818.370
優先度9 ルール (2 ユーザー、2 ロール)0.0163895.313

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