Coder Social home page Coder Social logo

devashishdxt / desse Goto Github PK

View Code? Open in Web Editor NEW
105.0 4.0 8.0 111 KB

Ultra fast binary serialization and deserialization for types with a constant size (known at compile time).

License: Apache License 2.0

Rust 100.00%
rust binary serialization no-std

desse's People

Contributors

dependabot-preview[bot] avatar devashishdxt avatar dingelish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

desse's Issues

`Desse::deserialize_from()` should return a `Result`

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().

Benchmark bincode serialization using 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)));
        })
    }),

Optional Default types instead of zero-initialized data?

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.