-
-
Notifications
You must be signed in to change notification settings - Fork 77
Description
According to this point: https://github.com/msgpack/msgpack/blob/master/spec.md#serialization
If an object can be represented in multiple possible output formats, serializers SHOULD use the format which represents the data in the smallest number of bytes.
I'm quite sure that the issue is mainly related to the spec itself that does not correctly exploits some strings representation well known and largely used (I'm going to submit a proposal for a few new types which can be highly compressed).
Even though the spec does not define the behavior in regard of predefined types in cases when applications want to override the default representation and are able to compress the data more than the standard serializer does, I suspect that each implementation should let the client to offer a different serializer for any of the predefined and handled type.
For example a client which knows its strings adhere to a well defined pattern can exploit the fact and the implementation should choose between the two different approaches using "the format which represents the data in the smallest number of bytes".
This implementation neither lets user defined functions to be used instead of the default ones nor lets the clients to propose a different approach.
It prefers the default one and that's all. A different approach could be appreciated.