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

Doubles: reasons for disallowing exponential form #37

Open
mgravell opened this issue Feb 23, 2020 · 2 comments
Open

Doubles: reasons for disallowing exponential form #37

mgravell opened this issue Feb 23, 2020 · 2 comments

Comments

@mgravell
Copy link
Contributor

mgravell commented Feb 23, 2020

The specification indicates, for doubles:

Exponential format is invalid.

However, this means that very large and very small values are now very verbose on the wire; additionally, many frameworks make not using E format challenging. This is also contrary to previous redis handling, which allows E formats, for example in the INCRBYFLOAT documentation there exists the sample:

INCRBYFLOAT mykey 2.0e2

For example, IEEE754's max/min values would be over 300 bytes, to transmit a theoretically 8 byte payload.

I'd like to challenge whether this is a good idea, preferring to allow exponential form when appropriate. It is also notable that some platforms make it actively hard to not use E form.

@kristoff-it
Copy link

It is also notable that some platforms make it actively hard to not use E form.

RESP3 only changes how replies are generated by the server, which is somewhat orthogonal to how commands work as all arguments are ultimately sent as strings to them.
If your client library is able to handle a superset of what the server will send you, you're still fine.

Your points about space savings are still perfectly valid though.

@mgravell
Copy link
Contributor Author

@kristoff-it I reject that statement due to the premise of RESP3 not being simply redis:

however the protocol is designed to be used by other projects

(from the home page)

So: the format needs to be considered in the general case, not simply with the added caveat that one particular usage never uses a particular message type in a particular direction.

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