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

Will Currie commented on SOLR-12407:
------------------------------------

I initially mentioned this on the [mailing 
list|http://mail-archives.apache.org/mod_mbox/lucene-solr-user/201805.mbox/%3CCAPYmcO21%3DQpDzudWwTA9jt9687YOt%2BbE2adsiL6cwoA-D-Sj-A%40mail.gmail.com%3E].
 The stack trace diff maybe helps show what I'm talking about. I don't know 
enough to propose a fix/alternative sorry.

 
jstack from 7.2:
 
"qtp2136344592-24" #24 prio=5 os_prio=31 tid=0x00007f80630e5000 nid=0x7103 
runnable [0x00007000049bb000]
   java.lang.Thread.State: RUNNABLE
at 
org.apache.lucene.queries.function.valuesource.ProductFloatFunction.func(ProductFloatFunction.java:41)
at 
org.apache.lucene.queries.function.valuesource.MultiFloatFunction$1.floatVal(MultiFloatFunction.java:82)
at 
org.apache.lucene.queries.function.valuesource.IfFunction$1.floatVal(IfFunction.java:64)
at 
org.apache.lucene.queries.function.valuesource.ProductFloatFunction.func(ProductFloatFunction.java:41)
at 
org.apache.lucene.queries.function.valuesource.MultiFloatFunction$1.floatVal(MultiFloatFunction.java:82)
at 
org.apache.lucene.queries.function.valuesource.IfFunction$1.floatVal(IfFunction.java:64)
at 
org.apache.lucene.queries.function.valuesource.IfFunction$1.floatVal(IfFunction.java:64)
at 
org.apache.lucene.queries.function.valuesource.ProductFloatFunction.func(ProductFloatFunction.java:41)
at 
org.apache.lucene.queries.function.valuesource.MultiFloatFunction$1.floatVal(MultiFloatFunction.java:82)
 *at 
org.apache.lucene.queries.function.BoostedQuery$CustomScorer.score(BoostedQuery.java:124)*
at 
org.apache.lucene.search.TopScoreDocCollector$SimpleTopScoreDocCollector$1.collect(TopScoreDocCollector.java:64)
at org.apache.lucene.search.Weight$DefaultBulkScorer.scoreAll(Weight.java:233)
at org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:184)
at org.apache.lucene.search.BulkScorer.score(BulkScorer.java:39)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:660)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:462)
at 
org.apache.solr.search.SolrIndexSearcher.buildAndRunCollectorChain(SolrIndexSearcher.java:215)
 
jstack from 7.3.1:
 
"qtp559670971-25" #25 prio=5 os_prio=31 tid=0x00007fe23fa0c000 nid=0x7303 
runnable [0x000070000b024000]
   java.lang.Thread.State: RUNNABLE
at 
org.apache.lucene.queries.function.valuesource.IfFunction$1.floatVal(IfFunction.java:64)
at 
org.apache.lucene.queries.function.valuesource.ProductFloatFunction.func(ProductFloatFunction.java:41)
at 
org.apache.lucene.queries.function.valuesource.MultiFloatFunction$1.floatVal(MultiFloatFunction.java:82)
at 
org.apache.lucene.queries.function.valuesource.IfFunction$1.floatVal(IfFunction.java:64)
at 
org.apache.lucene.queries.function.valuesource.ProductFloatFunction.func(ProductFloatFunction.java:41)
at 
org.apache.lucene.queries.function.valuesource.MultiFloatFunction$1.floatVal(MultiFloatFunction.java:82)
at 
org.apache.lucene.queries.function.valuesource.IfFunction$1.floatVal(IfFunction.java:64)
at 
org.apache.lucene.queries.function.valuesource.IfFunction$1.floatVal(IfFunction.java:64)
at 
org.apache.lucene.queries.function.valuesource.ProductFloatFunction.func(ProductFloatFunction.java:41)
at 
org.apache.lucene.queries.function.valuesource.MultiFloatFunction$1.floatVal(MultiFloatFunction.java:82)
 *at 
org.apache.lucene.queries.function.docvalues.FloatDocValues.doubleVal(FloatDocValues.java:67)*
 *at 
org.apache.lucene.queries.function.ValueSource$WrappedDoubleValuesSource$1.doubleValue(ValueSource.java:217)*
 *at org.apache.lucene.search.DoubleValues$1.doubleValue(DoubleValues.java:48)*
 *at 
org.apache.lucene.queries.function.FunctionScoreQuery$MultiplicativeBoostValuesSource$1.doubleValue(FunctionScoreQuery.java:199)*
 *at 
org.apache.lucene.queries.function.FunctionScoreQuery$FunctionScoreWeight$1.score(FunctionScoreQuery.java:171)*
at 
org.apache.lucene.search.TopScoreDocCollector$SimpleTopScoreDocCollector$1.collect(TopScoreDocCollector.java:64)
at org.apache.lucene.search.Weight$DefaultBulkScorer.scoreAll(Weight.java:233)
at org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:184)
at org.apache.lucene.search.BulkScorer.score(BulkScorer.java:39)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:660)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:462)
at 
org.apache.solr.search.SolrIndexSearcher.buildAndRunCollectorChain(SolrIndexSearcher.java:215)

> edismax boost performance regression from deprecating BoostedQuery
> ------------------------------------------------------------------
>
>                 Key: SOLR-12407
>                 URL: https://issues.apache.org/jira/browse/SOLR-12407
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>    Affects Versions: 7.3
>            Reporter: Will Currie
>            Priority: Minor
>         Attachments: restore-boosted-query.patch, solr-7.2.svg, solr-7.3.svg
>
>
> I'm seeing ~50% increase in query response time after upgrading from 7.2 to 
> 7.3 (600ms to 900ms). My queries use an edismax boost something like:
> {noformat}
> if(termfreq(type,"A"),product(map(field1,3,3,1.5,1),map(field1,4,4,1.9,1),if(def(field2,false),product(map(field1,1,1,0.6,1),map(field1,2,2,0.7,1),if(not(exists(field1)),0.6,1),map(field3,0,0,1.3,1)),product(map(field1,1,1,0.7,1),map(field1,2,2,1.1,1),if(not(exists(field1)),0.90,1),map(field3,0,0,1.50,1)))),1){noformat}
> This boost is likely (surely?) suboptimal but LUCENE-8099 appears to have 
> introduced this performance regression (poured proverbial oil on my 
> smouldering fire). If I change ExtendedDismaxQParser back to using the 
> deprecated BoostedQuery I get the 600ms solr 7.2 response time back.
> It appears FunctionScoreQuery invokes the boost function twice for each 
> document. Once with a call to 
> [exists()|https://github.com/apache/lucene-solr/blob/03afeb7766a39996de3c85e8a6ab24d2a352dd1c/lucene/queries/src/java/org/apache/lucene/queries/function/ValueSource.java#L150]
>  from 
> [advanceExact()|https://github.com/apache/lucene-solr/blob/42154387d4f2a6060da09c4236e2a8dbb575c59e/lucene/queries/src/java/org/apache/lucene/queries/function/FunctionScoreQuery.java#L170],
>  then a second time from the call chain following scores.doubleValue().
> I don't know if that's the cause of the slowdown but I'm definitely seeing a 
> slowdown that disappears when I revert part of LUCENE-8099.
> I've attached some flamegraphs comparing 7.2 and 7.3. The frame 
> FunctionScoreQuery$FunctionScoreWeight$1.score in solr-7.3.svg show 2 
> "towers". One for advanceExact (calling exists()), the other for 
> doubleValue() which ends up similar to solr-7.2.svg.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to