devashishdxt / desse Goto Github PK
View Code? Open in Web Editor NEWUltra fast binary serialization and deserialization for types with a constant size (known at compile time).
License: Apache License 2.0
Ultra fast binary serialization and deserialization for types with a constant size (known at compile time).
License: Apache License 2.0
This is not a bug report in a traditional sense, but I was curious to find out more about desse.
I noticed that desse currently uses std::mem::zeroed()
, which is being deprecated in favour for mem::MaybeUninit::zeroed
. Would it make sense to (optionally) leverage the Default
trait if a type implements it? This would be safe code. Or does this cause too much performance overhead (if you happen to have run experiments along those lines)?
Thank you for your time!
This would be pretty handy.
Consider this function: https://github.com/devashishdxt/desse/blob/master/desse/src/desse.rs#L266
If I will pass incorect Unicode value, it will trigger UB. However, it mustn't because it is not declared as unsafe.
AFAIC this can only be fixed by introducing new trait fn, deserialize_from_unchecked
There are many scenarios where deserialization of an object can fail. One such scenario is mentioned here. To handle these usecases and to make it easy for users of this crate to handle errors, Desse::deserialize_from()
should return Result
. In future, we can also consider returning Result
from Desse::serialize()
and Desse::serialize_into()
.
This is more directly comparable against desse because this way both libraries avoid memory allocation by writing into an existing buffer.
.with_function("bincode::serialize", |b| {
let mut buffer = Vec::new();
b.iter(|| {
buffer.clear();
let my_struct: MySerdeStruct = MySerdeStruct { a: 253, b: 64016 };
black_box(serialize_into(&mut buffer, black_box(&my_struct)));
})
}),
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.