Skip to content

Optimize numeric value serialization/deserialization #109

Description

@letmutx

We call num.to_string().as_bytes() to serialize and deserialize numbers when setting them in memcache server. Instead, we could use byteorder crate's read_u16, read_u64 etc. and write out the bytes to the server with a specific endianness(big/little) and use the same when deserializing.
deserialization:

let s: String = FromMemcacheValue::from_memcache_value(value, 0)?;

serialization:
match stream.write_all(self.to_string().as_bytes()) {

return self.to_string().as_bytes().len();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions