[
https://issues.apache.org/jira/browse/LUCENE-7577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15708807#comment-15708807
]
Robert Muir commented on LUCENE-7577:
-------------------------------------
Well, I'm not that strongly opinionated on it to block the change, I just think
its important to look at the tradeoffs. This class is a part of indexwriter,
and indexwriter is complicated.
I don't think its good to let some esoteric queries make the index package even
more complicated than it needs to be.
I already don't like that termsquery & co use it from the beginning, i mean
that change is really unfortunate since it means prefixcodedterms and ramfile
both have to have hashcode/equals at all: just to support these queries!
adding stuff like caching the hashcode, i mean its not that i'm against that
one little change, esp since its immutable, but its just continuing in the same
direction.
Its also the case that lucene queries have historically had a ton of hashcode
and equals bugs, and adding optimizations for that, man, I honestly think that
isn't a good idea and shouldnt be done at all, anywhere. Lucene isn't tall
enough to ride, it shouldn't have optimizations like this unless something is
changed to show it can have correctness first. but adding those optos to a
piece that indexwriter uses for low level stuff? IMO that's even more
dangerous, especially around equals/hashcode which could easily "slip in" to IW
without much notice due to how it works in java.
> PrefixCodedTerms should cache its hash code
> -------------------------------------------
>
> Key: LUCENE-7577
> URL: https://issues.apache.org/jira/browse/LUCENE-7577
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Adrien Grand
> Assignee: Adrien Grand
> Priority: Minor
> Attachments: LUCENE-7577.patch
>
>
> We have several queries that cache the hashcode of a PrefixCodedTerms
> instance on top of it, so we could simplify by moving the caching to
> PrefixCodedTerms directly.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]