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

Michael McCandless commented on LUCENE-5703:
--------------------------------------------

bq. Maybe we should make BinaryDocValues responsible for managing the BytesRef 
entirely by changing the method signature to BytesRef get(int docId) similarly 
to BytesRef next() in TermsEnum?

+1, also like DocsAndPositionsEnum.getPayload().

Then it's the caller's job to make a deep copy of the BytesRef if they need to 
retain it.

> Don't allocate/copy bytes all the time in binary DV producers
> -------------------------------------------------------------
>
>                 Key: LUCENE-5703
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5703
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>             Fix For: 5.0
>
>
> Our binary doc values producers keep on creating new {{byte[]}} arrays and 
> copying bytes when a value is requested, which likely doesn't help 
> performance. This has been done because of the way fieldcache consumers used 
> the API, but we should try to fix it in 5.0.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to