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

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

This patch only changes the on-disk format right?  The specialized
in-memory readers are still backed by native arrays
(short[]/int[]/long[], etc.)?

Instead of PackedInts.VERSION_CURRENT = 1 can we add
VERSION_BYTE_ALIGNED = 1 and then set VERSION_CURRENT =
VERSION_BYTE_ALIGNED?

Also, can we leave VERSION_START = 0 (ie don't rename that to
VERSION_LONG_ALIGNED)?  But we should put a comment saying that one
was long aligned ...

Ie, in general, I think the version constants should be created once
and then not changed (write once), and VERSION_CURRENT changes to
point to whichever is most recent.

That careful anonymous subclass in PackedInts to handle seeking to the
end when the last value is read is sort of sneaky ... this should only
kick in when reading the old (long-aligned) format right?  Can you add
an assert checking that the version is VERSION_START?  Or ... maybe
... we should not "promise" this (no trailing wasted bytes) in the
API?  Or maybe we expose a new explicit method to "seek to the end of
this packed ints" or something (eg maybe "skipTrailingBytes").

                
> 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