feat: Basic model speedup#245
Conversation
…ad of vector<vector> for policies storage
… base collection on compilation
|
@EmperorYP7 @sheny1xuan @cs1137195420 please review |
|
@AlexeyChashchegorov fix CI: |
|
I will figure out why it fails. My local build on osx passed with no problems. |
… model (allow) on enforcement
…set policy storage
c12899d to
44acb19
Compare
cba4788 to
e4d5037
Compare
e4d5037 to
3f2d7c4
Compare
|
PR description updated.
|
|
several comments:
|
|
@AlexeyChashchegorov plz fix CI errors: |
|
I have just 20.04.6 and g++9.4 (not g++9.3 that used on CI). But it pretty same to fix most of the bugs of build on Linux and to have unittests passed. I have some problems on build of py bindings. But I believe it may be compiler specific problem. |
|
@AlexeyChashchegorov plz fix: |
|
I will look at CI. Some time needed to get Win host available to compile. @hsluoyz If you can direct me how to get proper Win host / pod with appropriate compiler to debug - I will be very appreciative. ( On my side it might consume more time ) |
|
It should works for Windows as well now. |
|
🎉 This PR is included in version 1.55.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |



Description
Brief: I have production case that uses big amount of simple policies (~100K) that need to have enforcement time < 50ms.
This use case have low performance at casbin-cpp. Casbin-cpp cashing not comes the solution - on uniform distribution of request. Cash filling is quite long.
I have implemented unordered_set storage for policies for "basic model with allow only" to be used on enforcement.
--==Solution have performance gain X185 times. ==--
This gain will not depend on policies count anymore - O(1) complexity of traverse on enforcement:
Before the modification:
After the modification:
Workaround:
Traversing of policies on enforcement at casbin-cpp implemented for vector. That quite long on using not first (but last ) element of the vector. It nice to reflect this on benchmark.
Solution:
Provements:
Results of running:
Screenshots/Testimonials
Actions on the PR: