You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to update my serialization benchmarks for alkahest from 0.1.5 to 0.3.0 but am struggling to figure out what the correct API migration path is:
It looks like there are both deserialize and deserialize_in_place methods available - which of those corresponds with a proper buffer-to-object deserialization? I thinkdeserialize is the correct answer.
I'm looking for the zero-copy API that existed in 0.1 and can't seem to figure out where it is. I see Lazy which looks like the correct wrapper, but can't figure out how to make a Lazy from a byte buffer.
Thanks for all your hard work!
The text was updated successfully, but these errors were encountered:
The API has been changed significantly.
And I hope it was simplified. At least that was one of the goals.
So 'deserialize' creates new value from raw bytes and 'deserialize_in_place' populates existing value.
This works similar to serde's methods of 'Deserialize' trait.
Alkahest no longer generates types to serialize and read data, instead user may implement 'Serialize' and 'Deserialize' traits or derive them.
'Lazy' type is closest to zero-copy deserialization in Alkahest now.
It is deserializable from formula in its type parameter, but deserialization is no-op as it just copies reference to bytes slice and size.
User may later deserialize from Lazy into any type that is deserializable from formula in type parameter.
If formula is a slice, there's additional option to iterate over serialized values deserializing them one by one.
To get 'Lazy' value, just derive 'Deserialize' for a type, using 'Lazy' for the field that you want to deserialize lazily. Make sure to use field type in formula type as type parameter to 'Lazy'.
I'm trying to update my serialization benchmarks for alkahest from 0.1.5 to 0.3.0 but am struggling to figure out what the correct API migration path is:
deserialize
anddeserialize_in_place
methods available - which of those corresponds with a proper buffer-to-object deserialization? I thinkdeserialize
is the correct answer.Lazy
which looks like the correct wrapper, but can't figure out how to make aLazy
from a byte buffer.Thanks for all your hard work!
The text was updated successfully, but these errors were encountered: