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
What do you think about serializing numeric types with the smallest lossless format? For example, if I have a double[] of length N containing 0's and 1's, its contents (after the header) would be stored using N bytes, because 0 and 1 fit losslessly into a positive fixnum. If I try to then deserialize to a double[], that would work.
msgpack-cli is already doing this for ints and uints internally.
The implementation of DoubleMsgPackValue.Pack would become something logically similar to this:
I've actually tried this locally now, and it's working great. Deserialization appears to already handle this without any changes. That is, if you try to deserialize a uint fixnum containing the value 0 (hex 00) into a C# double that works correctly.
What do you think about serializing numeric types with the smallest lossless format? For example, if I have a
double[]
of length N containing 0's and 1's, its contents (after the header) would be stored using N bytes, because 0 and 1 fit losslessly into a positive fixnum. If I try to then deserialize to adouble[]
, that would work.msgpack-cli is already doing this for ints and uints internally.
The implementation of
DoubleMsgPackValue.Pack
would become something logically similar to this:What are your thoughts? This could potentially be an optional configuration on the MessagePackWriter. I'd be willing to help out with this.
The text was updated successfully, but these errors were encountered: