From 8fbed75bd1bea7df6b5034da94f1980ff891c750 Mon Sep 17 00:00:00 2001 From: David Koloski Date: Mon, 30 Nov 2020 13:23:23 -0600 Subject: [PATCH 1/2] N16: rkyv --- content/posts/newsletter-016/index.md | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/content/posts/newsletter-016/index.md b/content/posts/newsletter-016/index.md index f83eadf6c..91945f178 100644 --- a/content/posts/newsletter-016/index.md +++ b/content/posts/newsletter-016/index.md @@ -67,6 +67,39 @@ If needed, a section can be split into subsections with a "------" delimiter. ## Library & Tooling Updates +### [rkyv] + +[rkyv] is a zero-copy deserialization framework for Rust. It's similar to +FlatBuffers and Cap'n Proto and can be used for data storage and messaging. + +It has a handful of features that make it stand out: + +- No schema restrictions +- HashMap support out of the box +- Trait object support through the [`rkyv_dyn`] crate +- Validation through the [`bytecheck`] crate, suitable for untrusted and potentially malicious data +- Safe mutable archives with pinning + +Reddit user [vlmutolo] also made a [toy benchmark] comparing rkyv against serde and bincode and found that rkyv had promising initial numbers: + +``` +serialize (bincode): 89 ns/iter +serialize (rkyv): 86 ns/iter + +deserialize (bincode): 118 ns/iter +deserialize (rkyv): 16 ns/iter +``` + +_Discussions: +[/r/rust (v0.1)](https://www.reddit.com/r/rust/comments/jss6h4/rkyv_a_zerocopy_deserialization_framework_for_rust/), +[/r/rust (v0.2)](https://www.reddit.com/r/rust/comments/jx32e8/rkyv_02_and_bytecheck_validation_mutable_archives/)_ + +[rkyv]: https://github.com/djkoloski/rkyv +[`rkyv_dyn`]: https://docs.rs/rkyv_dyn +[`bytecheck`]: https://github.com/djkoloski/bytecheck +[vlmutolo]: https://www.reddit.com/r/rust/comments/jx32e8/rkyv_02_and_bytecheck_validation_mutable_archives/gcyfoqc +[toy benchmark]: https://git.sr.ht/~vlmutolo/rkyv-bench/tree/master/src/main.rs + ## Popular Workgroup Issues in Github From 6f1a9c5f624df1f5a6d65e4c4cd6a2e2a8261d7c Mon Sep 17 00:00:00 2001 From: David Koloski Date: Mon, 30 Nov 2020 13:41:46 -0600 Subject: [PATCH 2/2] Fix linter errors, add write-up link --- content/posts/newsletter-016/index.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/content/posts/newsletter-016/index.md b/content/posts/newsletter-016/index.md index 91945f178..072fc1934 100644 --- a/content/posts/newsletter-016/index.md +++ b/content/posts/newsletter-016/index.md @@ -77,12 +77,14 @@ It has a handful of features that make it stand out: - No schema restrictions - HashMap support out of the box - Trait object support through the [`rkyv_dyn`] crate -- Validation through the [`bytecheck`] crate, suitable for untrusted and potentially malicious data +- Validation through the [`bytecheck`] crate, suitable for untrusted and +potentially malicious data - Safe mutable archives with pinning -Reddit user [vlmutolo] also made a [toy benchmark] comparing rkyv against serde and bincode and found that rkyv had promising initial numbers: +Reddit user [vlmutolo] also made a [toy benchmark] comparing rkyv against serde +and bincode and found that rkyv had promising initial numbers: -``` +```text serialize (bincode): 89 ns/iter serialize (rkyv): 86 ns/iter @@ -90,6 +92,8 @@ deserialize (bincode): 118 ns/iter deserialize (rkyv): 16 ns/iter ``` +A write-up on the [architecture and internals of rkyv] is also available. + _Discussions: [/r/rust (v0.1)](https://www.reddit.com/r/rust/comments/jss6h4/rkyv_a_zerocopy_deserialization_framework_for_rust/), [/r/rust (v0.2)](https://www.reddit.com/r/rust/comments/jx32e8/rkyv_02_and_bytecheck_validation_mutable_archives/)_ @@ -99,6 +103,7 @@ _Discussions: [`bytecheck`]: https://github.com/djkoloski/bytecheck [vlmutolo]: https://www.reddit.com/r/rust/comments/jx32e8/rkyv_02_and_bytecheck_validation_mutable_archives/gcyfoqc [toy benchmark]: https://git.sr.ht/~vlmutolo/rkyv-bench/tree/master/src/main.rs +[architecture and internals of rkyv]: https://davidkoloski.me/blog/rkyv-architecture/ ## Popular Workgroup Issues in Github