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

Lu Xugang edited comment on LUCENE-10603 at 6/10/22 5:01 AM:
-------------------------------------------------------------

Hi, [~gsmiller] , my initial thought was just wanna keep code consistency 
between SortedSetDocValues and SortedNumericDocValues because their logic of 
multi-values iteration were so similar, it is just a "spotless" change.

{quote}we think the loops can be better optimized by the JVM/hotspot since the 
number of iterations is known ahead of time{quote}

Sorry for that I am not good at JVM and  not sure whether this change could be 
optimized


was (Author: chrislu):
Hi, [~gsmiller] , my initial thought was just wanna to keep code consistency 
between SortedSetDocValues and SortedNumericDocValues because their logic of 
multi-values iteration were so similar, it is just a spotless change.

{quote}we think the loops can be better optimized by the JVM/hotspot since the 
number of iterations is known ahead of time{quote}

Sorry for that I am not good at JVM and  not sure whether this change could be 
optimized

> Improve iteration of ords for SortedSetDocValues
> ------------------------------------------------
>
>                 Key: LUCENE-10603
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10603
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Lu Xugang
>            Priority: Trivial
>
> After SortedSetDocValues#docValueCount added since Lucene 9.2, should we 
> refactor the implementation of ords iterations using docValueCount instead of 
> NO_MORE_ORDS?
> Similar how SortedNumericDocValues did
> From 
> {code:java}
> for (long ord = values.nextOrd();ord != SortedSetDocValues.NO_MORE_ORDS; ord 
> = values.nextOrd()) {
> }{code}
> to
> {code:java}
> for (int i = 0; i < values.docValueCount(); i++) {
>   long ord = values.nextOrd();
> }{code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to