-
Notifications
You must be signed in to change notification settings - Fork 157
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
rkyv support #316
Comments
👋 Thanks for opening this issue! Get help or engage by:
|
There is an ongoing PR to make What you need looks similar to this? An optional feature that enables several rkyv I do not have any experience on rkyv other than reading its API doc:) |
Adding rkyv support would be a nice addition indeed. It's a very efficient format wrt (de)serialization speed which can easily become a bottleneck. IMHO the solution outlined in the comment #243 (review) in the currently open serde PR would be a very simple and good solution wrt maintainablity. |
Hi All, I'm looking at adding this feature and ran into a small issue. Is there any issue with moving away from using AnyError directly in some of the messages? An example: https://github.com/datafuselabs/openraft/blob/db047b978e08fdb6f23bc4c27f94d4bd36ab925b/openraft/src/error.rs#L314-L320 (Edit) (Edit 2) |
It is possible to add rkyv to AnyError. But AFAIK, only types that need to be persisted on disk need rkyv support. The response and response errors are small structs, maybe it's possible to use some other serialization such as |
I'm trying to use openraft with 20k+ messages per second, and I seem to be running into quite a bit of overhead simply allocating/copying/serializing stuff. I'm currently using bincode, but would like to switch to rkyv as I believe it will do better.
Unfortunately rkyv doesn't work with serde Serialize/Deserialize (due to fundamental differences around supporting zero-copy), and thus there would need to be support added into openraft for me to be able to use rkyv to serialize things like
VoteRequest
/AppendEntriesRequest
/InstallSnapshotRequest
.I think it would just be a matter of adding some different derives behind a feature flag for rkyv. Is there interest in this? If so I will try to make a PR.
The text was updated successfully, but these errors were encountered: