Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This implementation does not strictly adhere to the spec #10

Open
skypjack opened this issue Jan 9, 2015 · 1 comment
Open

This implementation does not strictly adhere to the spec #10

skypjack opened this issue Jan 9, 2015 · 1 comment

Comments

@skypjack
Copy link

skypjack commented Jan 9, 2015

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.

@mcollina
Copy link
Owner

mcollina commented Jan 9, 2015

All true, but I am a little low on bandwidth to tackle this feature.
However, if you would like to do it, I'll be glad to review and merge.

Also, I took all the possible shortcuts while implementing this library, so
a refactoring might help :).
Il giorno ven 9 gen 2015 alle 21:31 Michele Caini [email protected]
ha scritto:

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.


Reply to this email directly or view it on GitHub
#10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants