[
https://issues.apache.org/jira/browse/LUCENE-6821?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14942325#comment-14942325
]
Adrien Grand commented on LUCENE-6821:
--------------------------------------
I don't think we should bother at all: executing a term query already performs
I/O operations and allocates several objects *per segment* to create terms
enums, scorers, iterators, leaf collectors, etc. so adding two extra object
allocations to clone the incoming term is very unlikely to have noticeable
impact on gc activity.
> TermQuery's constructors should clone the incoming term
> -------------------------------------------------------
>
> Key: LUCENE-6821
> URL: https://issues.apache.org/jira/browse/LUCENE-6821
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Adrien Grand
> Priority: Minor
> Attachments: LUCENE-6821.patch
>
>
> This is a follow-up of LUCENE-6435: the bug stems from the fact that you can
> build term queries out of shared BytesRef objects (such as the ones returned
> by TermsEnum.next), which is a bit trappy. If TermQuery's constructors would
> clone the incoming term, we wouldn't have this trap.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]