-
Notifications
You must be signed in to change notification settings - Fork 40
replace rkyv with custom serde
#1207
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
Conversation
585ecec to
84625fd
Compare
ebff007 to
18cbd19
Compare
kunxian-xia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except one minor issue.
| let mut cursor = len_start; | ||
| let data_offset = unsafe { ptr::read(cursor) }; | ||
| cursor = unsafe { cursor.add(1) }; | ||
| self.alignment = unsafe { ptr::read(cursor) }; | ||
| cursor = unsafe { cursor.add(1) }; | ||
| self.next_len_at = cursor; | ||
| self.next_data_at = unsafe { data_start.add(data_offset) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: add a link to the function finalize() in ceno_host/src/lib.rs so that whenever we make any change here, we won't forget to reflect it there.
58bc8d7 to
2e32d99
Compare
Follow up on #1171
replace
rkyvwith custom serde for 2 reasonsrkyvfriendly struct, or leverage external library, e.g. "rkyv + bincode".rkyvfriendly struct is not friendly for existing application in particular struct are defined in 3rd-party library. Thus previously we integrate bincode for the serialiation to bytes. This bring extra effort for guest program as we need bincode to deserialize back to owned struct.rkyvwill access high addr to retrieve some meta information before sequential read. Below are example read patternThe high order access not friendly if we want to record max accessed address in each shard for memory region initialized across shard.
New
ceno_serdecrates credits to https://github.com/openvm-org/openvm/tree/main/crates/toolchain/openvm/src/serdebenchmark
Run on 23817600 with K=6, cache trace = none, 1x4090
Overall cycle
322620252->315955342(2.06%)