Repository navigation
Write and read msgpack in Rust - #25
Merged
Merged
Conversation
…rs and a __new__ of the extension's own
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #24 (the descriptors): until that is merged, this shows its commit too.
The generated structs are written as msgpack, and read from it, by Rust itself: as WIRE_FORMAT.md has it, which Python and C++ write and read.
dataclass_native::msgpack::{to_msgpack, from_msgpack}, in the crate, which still depends on nothing: so by Rust alone, with no Python.dataclass-native generate rustimplements itsWirefor each struct, enum and union, and says of each whether it is written as a bundle, which the schema tells.__msgpack__and__from_msgpack__, as those of C++ have, soto_msgpackandfrom_msgpackof what is bound to Rust no longer go by way of Python.Decimal::parse, as C++ has.On an Apple M1, of extensions built for release, in microseconds for each
Orderof the README's Performance section:pureTested by the tests of msgpack which are for every mode, run with the extension, including those of data which is rejected; and by a program of Rust alone, which cargo runs. Also checked, though not kept as a test: of 22 objects of most kinds of field, Rust writes the bytes which the Python reference does; and of some 8,800 corruptions of them, Rust and C++ each took or rejected the same, and wrote the same of what they took.
JSON and Arrow are still done by Python for what Rust holds, and are to follow.