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

Simon Willnauer commented on LUCENE-3328:
-----------------------------------------

bq. I think advancing the lead in program code at the place of the break 
comment could fix this.
Paul this works and looks as expected. Once we break to the advanceHead label 
we step out the inner do {} while; and advance the head. Maybe I don't 
understand your comment correctly?

There is certainly space for improvement here. for instance could the head be 
advanced to the doc we break on but the advance call there actually yields a 
perf hit. Yet, we can play some tricks like if (DF / maxdoc > X) 
enum.advance(x) else while(x > enum.nextDoc()); which I think I'll look into 
after vacation :)

> Specialize BooleanQuery if all clauses are TermQueries
> ------------------------------------------------------
>
>                 Key: LUCENE-3328
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3328
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 3.4, 4.0
>            Reporter: Simon Willnauer
>            Assignee: Simon Willnauer
>             Fix For: 4.0
>
>         Attachments: LUCENE-3328.patch, LUCENE-3328.patch, LUCENE-3328.patch
>
>
> During work on LUCENE-3319 I ran into issues with BooleanQuery compared to 
> PhraseQuery in the exact case. If I disable scoring on PhraseQuery and bypass 
> the position matching, essentially doing a conjunction match, 
> ExactPhraseScorer beats plain boolean scorer by 40% which is a sizeable gain. 
> I converted a ConjunctionScorer to use DocsEnum directly but still didn't get 
> all the 40% from PhraseQuery. Yet, it turned out with further optimizations 
> this gets very close to PhraseQuery. The biggest gain here came from 
> converting the hand crafted loop in ConjunctionScorer#doNext to a for loop 
> which seems to be less confusing to hotspot. In this particular case I think 
> code specialization makes lots of sense since BQ with TQ is by far one of the 
> most common queries.
> I will upload a patch shortly

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to