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

Adrien Grand edited comment on LUCENE-4098 at 6/1/12 6:23 PM:
--------------------------------------------------------------

The bulk get and set are not guaranteed to return/set exactly len longs (so 
that they can stay at a block boundary to make the subsequent reads/writes 
faster). So I think
{code}
int got = packed1.get(start, buffer, offset, len);
assertTrue(got <= len);
int sot = packed2.set(start, buffer, offset, len);
assertTrue(sot <= len);
{code}
should be replaced with
{code}
int got = packed1.get(start, buffer, offset, len);
assertTrue(got <= len);
int sot = packed2.set(start, buffer, offset, got);
assertTrue(sot <= len);
{code}
                
      was (Author: jpountz):
    The bulk get and set are not guaranteed to return/set exactly len longs (so 
that they can stay at a block boundary to make the subsequent reads/writes 
faster). So I think
{{code}}
int got = packed1.get(start, buffer, offset, len);
assertTrue(got <= len);
int sot = packed2.set(start, buffer, offset, len);
assertTrue(sot <= len);
{{code}}
should be replaced with
{{code}}
int got = packed1.get(start, buffer, offset, len);
assertTrue(got <= len);
int sot = packed2.set(start, buffer, offset, got);
assertTrue(sot <= len);
{{code}}
                  
> Efficient bulk operations for packed integer arrays
> ---------------------------------------------------
>
>                 Key: LUCENE-4098
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4098
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/other
>            Reporter: Adrien Grand
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 4.1
>
>         Attachments: LUCENE-4098.patch, LUCENE-4098.patch
>
>
> There are some places in Lucene code that {iterate over,set} ranges of values 
> of a packed integer array. Because bit-packing implementations (Packed*) tend 
> be slower than direct implementations, this can take a lot of time.
> For example, under some scenarii, GrowableWriter can take most of its 
> (averaged) {{set}} time in resizing operations.
> However, some bit-packing schemes, such as the one that is used by 
> {{Packed64SingleBlock*}}, allow to implement efficient bulk operations such 
> as get/set/fill. Implementing these bulk operations in 
> {{PackedInts.{Reader,Mutable}}} and using them across other components 
> instead of their single-value counterpart could help improve performance.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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