-
Notifications
You must be signed in to change notification settings - Fork 12
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
Noop specification deserves clarification(s) #80
Comments
Definitely a miss on my part, that's a great point. On Thu, Oct 6, 2016 at 3:47 AM, Dorian [email protected] wrote:
|
@DbxDev, what to you mean by Do I think correctly? |
You are correct - the only way to omit the type marker for the container is On Tue, Nov 8, 2016 at 2:51 PM, tsieprawski [email protected]
|
You're right, the issue I raised actually cannot happen. Am I missing something here ? |
@DbxDev Yeah, noop-typed containers are weird. Semantically array is empty (just the length of array-on-the-fly and array-after-ignoring-noops are different), but with objects there go keys+noops (which make no sense). Maybe noops should not be allowed at all in containers? Or at least in non-optimized containers. Because, noop-typed make no sense (as above), and count-only optimized end up having less items than before parsing. For non-optimized ones, noops still serve as keepalive, and they can stay here. |
If so then when can you use them? |
My understanding of noop is for streaming channels and byte alignment issues. When you have a keep alive requirement in your value stream, you have to send "something" or the connection gets closed on you; send a Noop. Also if you would like to pad the end of your data stream to align on a better byte boundary for retrieving the next data element, a Noop can be used to fill the space. Nevermind about this, I found it. |
IMHO no-op should be completely removed because, again IMHO, it is a violation of the separation-of-concerns principle. Further, in the presence of no-op, applying the obvious optimisation of pre-allocating containers for arrays and objects when the size, but not the type, is given, can lead to unnecessarily large allocations since, at the extreme, the container might still be empty at the end. |
Noop is defined as a valueless value that can be added to the elements of a container.
That is not always true, in particular when the container is strongly typed and the type marker is omitted. In this case, there is no way to distinguish [N] from the integer 78.
For this particular reason, using noop as a way to remove data should be used with care, and is in practice not efficient because you first need to find how the container is defined (with optimized format or not).
The text was updated successfully, but these errors were encountered: