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

Markus Heiden commented on LUCENE-6365:
---------------------------------------

Removing init(): One my design goals was to be able to reuse this iterator, 
mainly to optimize the performance of the AnalyzingSuggester. This mainly comes 
from avoiding the step by step allocation of the stack inside the iterator over 
and over again. So maybe I can provide an additional constructor by combining 
the default constructor with the init() method?

Removing limit support: I like the idea, but as I tried to implement the 
change, it seems that there are some downsides: At least the AnalyzingSuggester 
and the CompletionTokenStream are using this feature. Especially annoying is to 
change the implementation of CompletionTokenStream, because it has no for loop. 
Maybe I can add a second init() method without limit, to not need to pass -1 
each time the limitation is not needed?

> Optimized iteration of finite strings
> -------------------------------------
>
>                 Key: LUCENE-6365
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6365
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/other
>    Affects Versions: 5.0
>            Reporter: Markus Heiden
>            Priority: Minor
>              Labels: patch, performance
>         Attachments: FiniteStringsIterator.patch, 
> FiniteStringsIterator2.patch, FiniteStringsIterator3.patch
>
>
> Replaced Operations.getFiniteStrings() by an optimized FiniteStringIterator.
> Benefits:
> Avoid huge hash set of finite strings.
> Avoid massive object/array creation during processing.
> "Downside":
> Iteration order changed, so when iterating with a limit, the result may 
> differ slightly. Old: emit current node, if accept / recurse. New: recurse / 
> emit current node, if accept.
> The old method Operations.getFiniteStrings() still exists, because it eases 
> the tests. It is now implemented by use of the new FiniteStringIterator.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to