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

Dawid Weiss commented on LUCENE-6365:
-------------------------------------

> 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. 

I wouldn't worry about it, Markus. With a TLAB these allocations are fairly 
cheap. You could just add a reasonably large initial stack and that's it. If it 
needs to reallocate, so be it. Unless it becomes a real bottleneck in real life 
(which it won't, I assure you), there is no need for premature optimizations at 
the cost of making the code more complex.

> 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