Numeric serialization bit compression?
Options
Are serialized numeric values serialized in a way that they don't send unnecessary bits? For example, if I send a new Hashtable {{(long)0, (long)0 }}, will the network packet actually have 16 bytes of data for that key/value pair? (ignoring headers etc)
If it does just blindly serialize according to type, is there some way to achieve this other than registering custom serialization routines that use BitConverter/BinaryWriter/etc?
I can probably figure this out via decompiled code, but I thought it might be better to just ask.
Thanks!
EDIT: I forgot to mention that I know casting to byte etc will solve this, but I was hoping for something more sophisticated that can automatically scale with the actual range of the value (e.g. zmq/protobuf).
If it does just blindly serialize according to type, is there some way to achieve this other than registering custom serialization routines that use BitConverter/BinaryWriter/etc?
I can probably figure this out via decompiled code, but I thought it might be better to just ask.
Thanks!
EDIT: I forgot to mention that I know casting to byte etc will solve this, but I was hoping for something more sophisticated that can automatically scale with the actual range of the value (e.g. zmq/protobuf).
0
Comments
-
Currently, we don't scale on actual size.
It's one of the features we want but didn't implement yet.0 -
Gotcha, thanks. It's not a problem. I just wanted to make sure.0