-
-
Notifications
You must be signed in to change notification settings - Fork 201
[PyCasbin-on-CPP] Benchmark the slow part of PyCasbin as the preparation for PyCasbin-on-CPP #225
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@ffyuanda @Zxilly @techoner @elfisworking |
@sheny1xuan will work on the Casbin-CPP part. @Abingcbc will work on the PyCasbin part. Please work together. |
If |
BTW, should we write an RFC first like the one of TensorFlow https://github.com/tensorflow/community/blob/master/rfcs/20190208-pybind11.md |
@Abingcbc good point! |
Today, it is also more an more common to bind Python over Rust instead of C/C++. Casbin have a Rust implementation (marked as "Producton ready"). This can achieve the same performance gain, but also bring the Rust security benefits. |
@leeqvip @Abingcbc @EmperorYP7 @sheny1xuan any comment on this? |
|
How i can contribute on this issuse |
I'm curious if there's been any progress in implementing pycasbin-on-cpp or if this issue is basically stalled? |
@EmperorYP7 @sheny1xuan what's the current status for pycasbin-on-cpp? |
The experiment shows that PyCasbin-on-CPP is not much faster than pure PyCasbin, maybe 5%~10% faster but this is not enough. Pure PyCasbin is much easier to maintain compared to the slightly faster PyCasbin-on-CPP. Closed here for now |
There are many users complaining PyCasbin about its bad performance compared to Go or Java. This is mostly because that PyCasbin is a pure Python implementation of Casbin. A common practice for popular Python libs for this is using a C++ backend and wrapping it with a Python interface, like numpy, tensorflow, pytorch. We can do similar and this plan is named "PyCasbin-on-CPP".
Recently the Casbin-CPP is already usable and some preparation work for PyCasbin-on-CPP is done: casbin/casbin-cpp#84 . The next question is which parts of the Python code and how much of them should be replaced by C++ code, only the evaluator code, or the enforce function, or even includes some other APIs.
We need to use some profiling tool to recognize the slow parts of PyCasbin. Then we replace them with C++ first ideally.
The text was updated successfully, but these errors were encountered: