-
Notifications
You must be signed in to change notification settings - Fork 18
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
homogeneous arrays #4
Comments
By homogenous do you mean "exact same superpack type tag" or "same type family but possibly varying size classes"? The latter feels like it would have a very complex specification/implementation and I don't think it would help much since we'd still have to spend at least a byte per element specifying size, so I'll comment on the former. If we look only for exact same superpack type tag, I think the cases where this would help are so narrow as to almost be contrived. The three most reasonable cases where I can see this helping significantly are:
How common are any of these? The latter two are so specific that I'm a bit dubious as to the frequency of circumstances in which this might be worth the additional spec and implementation complexity. At first glance I might be convinced by the string case, but note that it likely won't play well with the repeated string optimization. We only store strings in the lookup table if doing so will actually save space, so if we have an array containing a mix of one-off and repeated strings, we're out of luck. I think the only way we could still realize any benefit in this case would be to change the string lookup table to be of unbounded size, put every string (even one-offs) in the table, and change the I'd be interested to hear about the specific cases you have in mind where this would help significantly, or if you mean something other than what I've interpreted and commented on. |
I propose a new type for homogenous arrays which allows omitting the type tags of each of its elements. Most of the arrays I encode are homogenous and have more than one element, so this will save one byte per additional element.
The text was updated successfully, but these errors were encountered: