[ 
https://issues.apache.org/jira/browse/LUCENE-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13491479#comment-13491479
 ] 

Michael McCandless commented on LUCENE-4536:
--------------------------------------------

bq. These were my first ideas, but the truth is that I was very scared to break 
something (for example doc values rely on the assumption that after reading the 
last value of a direct array, the whole stream is consumed).

It's hard to know what's best :)

I like the explicitness / transparency / no sneaky code solution of
.skipTrailingBytes().

But then I don't like that skipTrailingBytes would only be for back
compat (ie, we will remove it eventually, unless somehow we go back to
wasted trailing bytes) ... annoying to add essentially a deprecated
API.

But then really it's "presumptuous" of the consumers of PackedInts to
expect all bytes are consumed after iterating all values ... like
that's making a sometimes invalid assumption about the file format of
PackedInts.

And this is an internal API so we are free to change things ..

But net/net I think we should stick w/ your current patch?

                
> Make PackedInts byte-aligned?
> -----------------------------
>
>                 Key: LUCENE-4536
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4536
>             Project: Lucene - Core
>          Issue Type: Task
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Minor
>             Fix For: 4.1
>
>         Attachments: LUCENE-4536.patch
>
>
> PackedInts are more and more used to save/restore small arrays, but given 
> that they are long-aligned, up to 63 bits are wasted per array. We should try 
> to make PackedInts storage byte-aligned so that only 7 bits are wasted in the 
> worst case.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to