-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf improvement : has_eval() in CoreEnforcer.enforce_ex #238
Labels
Comments
@ffyuanda @Zxilly @techoner @elfisworking |
@etienne-lebrun It should reuse |
etienne-lebrun
added a commit
to etienne-lebrun/pycasbin
that referenced
this issue
Jan 13, 2022
etienne-lebrun
added a commit
to etienne-lebrun/pycasbin
that referenced
this issue
Jan 13, 2022
etienne-lebrun
added a commit
to etienne-lebrun/pycasbin
that referenced
this issue
Jan 13, 2022
🎉 This issue has been resolved in version 1.15.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
In a simple profile calling enforce a few times,looping over ~500 policies, I have noticed that I spend almost 10% of my time in casbin.util.has_eval.
I believe it could be avoided if we reused the
has_eval
variable computed out of the loop (line 369). It could also probably be cached in the Assertion object stored inself.model["m"][mtype]
pycasbin/casbin/core_enforcer.py
Line 369 in a16bfaa
has_eval = util.has_eval(exp_string)
pycasbin/casbin/core_enforcer.py
Line 388 in a16bfaa
Let me know if you would like a PR
The text was updated successfully, but these errors were encountered: