I am going to weigh in on this, this function turns up in my profiler
dumps as being expensive (attached). My profiler output is from
lucene_3_5, so exacting details might deviate.
With that said, whilst it looks bad, I dont think for the case of
scaling a field its _that_ bad, essentially (as far as I can tell
through debugging) it boils down to iterating items from the field
cache, which is not the most expensive thing going. With that said, I
was personally thinking if it could be stored in the index, if you are
suggesting that its stored in the codecs with lucene4 that would be great.
In my case, I am wondering if it has a bad interaction with the grouping
feature introduced into 3.5; I think that the specific DocValues
instance it iterates over for groups might be something that is not as
cheap to iterate as the fieldCache and as a result causes the expensive
calls I see. I am currently looking at SOLR-3109, as I think the seen
expense of the Scale Function might be making that problem far worse.
If people want I can get harder better profiling output or debugging here.
-- Greg
On 09/02/12 12:52, Chris Hostetter wrote:
: can anyone confirm?
everything you said sounded right to me ... scale(...) as a general
purpose function probably can't be optimized very heaivly. but it would
probably be possible to write an optimization specific to
scale(fieldname).
I seem to recall someone saying something at some point about the idea of
having the codec record stats like the min/max value of a field (per
segment) ... assuming i'm not smoking crack, so you wouldn't have to do
any caching, you could have an optimized "scalefield(f)" function that
could fail hard if the field didn't use the expected codec type, otherwise
it just asked all the atomic readers what the min/max where to find the
overall min/max.
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Call tree (all threads together)
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¬âââââââââââââââââââââ¬ââââââââââââââââââ
â Name
â Time (ms) â Own Time
(ms) â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¼âââââââââââââââââââââ¼ââââââââââââââââââ¤
â
ââorg.apache.solr.handler.component.QueryComponent.process(ResponseBuilder)
â 993,965 63 % â
1 â
â â
â â
â
â âââ¬âorg.apache.solr.search.grouping.CommandHandler.execute()
â 623,143 40 % â
0 â
â â â
â â
â
â â âââ¬âorg.apache.lucene.search.IndexSearcher.search(Query,
Filter, Collector) â 320,197 20 %
â 0 â
â â â â
â â
â
â â â âââ¬âorg.apache.lucene.search.IndexSearcher.search(Weight,
Filter, Collector) â 320,154 20 %
â 0 â
â â â â â
â â
â
â â â â
âââ¬âorg.apache.lucene.search.FilteredQuery.getFilteredScorer(IndexReader,
Similarity, Weight, Weight, Filter) â 267,698 17 % â 0
â
â â â â â â
â â
â
â â â â â
âââ¬âorg.apache.solr.search.function.BoostedQuery$BoostedWeight.scorer(IndexReader,
boolean, boolean) â 267,698 17 % â 0 â
â â â â â â
â â
â
â â â â â
âââ¬âorg.apache.solr.search.function.BoostedQuery$CustomScorer.<init>(BoostedQuery,
Similarity, ...) â 267,484 17 % â 0 â
â â â â â â â
â â
â
â â â â â â
âââ¬âorg.apache.solr.search.function.BoostedQuery$CustomScorer.<init>(BoostedQuery,
Similarity, ...) â 267,484 17 % â 0 â
â â â â â â â
â â
â
â â â â â â
âââ¬âorg.apache.solr.search.function.MultiFloatFunction.getValues(Map,
IndexReader) â 267,484 17 % â 0 â
â â â â â â â
â â
â
â â â â â â
âââ¬âorg.apache.solr.search.Double2Parser$Function.getValues(Map,
IndexReader) â 267,484 17 % â 0
â
â â â â â â â
â â
â
â â â â â â
âââ¬âorg.apache.solr.search.function.TopValueSource.getValues(Map,
IndexReader) â 267,484 17 % â 0 â
â â â â â â â
â â
â
â â â â â â
ââââorg.apache.solr.search.function.ScaleFloatFunction.getValues(Map,
IndexReader) â 267,484 17 % â 267,484 â
â â â â â â
â â
â
â â â â â
ââââorg.apache.lucene.search.BooleanQuery$BooleanWeight.scorer(IndexReader,
boolean, boolean) â 213 0 % â 0 â
â â â â â
â â
â
â â â â
ââââorg.apache.lucene.search.FilteredQuery$2.score(Collector)
â 52,456 3 % â
621 â
â â â â
â â
â
â â â
ââââorg.apache.lucene.search.IndexSearcher.createNormalizedWeight(Query)
â 42 0 % â
0 â
â â â
â â
â
â â
âââ¬âorg.apache.solr.search.grouping.CommandHandler.computeDocSet(Query,
Filter, List) â 300,359 19 % â
61 â
â â â â
â â
â
â â â âââ¬âorg.apache.lucene.search.IndexSearcher.search(Query,
Filter, Collector) â 300,276 19 %
â 0 â
â â â â â
â â
â
â â â â
âââ¬âorg.apache.lucene.search.IndexSearcher.search(Weight, Filter,
Collector) â 300,271 19 % â
0 â
â â â â â â
â â
â
â â â â â
âââ¬âorg.apache.lucene.search.FilteredQuery.getFilteredScorer(IndexReader,
Similarity, Weight, Weight, ...) â 259,201 17 % â 3
â
â â â â â â â
â â
â
â â â â â â
âââ¬âorg.apache.solr.search.function.BoostedQuery$BoostedWeight.scorer(IndexReader,
boolean, boolean) â 259,197 17 % â 2 â
â â â â â â â
â â
â
â â â â â â
âââ¬âorg.apache.solr.search.function.BoostedQuery$CustomScorer.<init>(BoostedQuery,
Similarity, ...) â 259,003 17 % â 0 â
â â â â â â â â
â
â â
â â â â â â â
âââ¬âorg.apache.solr.search.function.BoostedQuery$CustomScorer.<init>(BoostedQuery,
Similarity, ...) â 259,003 17 % â 0 â
â â â â â â â â
â
â â
â â â â â â â
âââ¬âorg.apache.solr.search.function.MultiFloatFunction.getValues(Map,
IndexReader) â 259,003 17 % â 0 â
â â â â â â â â
â
â â
â â â â â â â
âââ¬âorg.apache.solr.search.Double2Parser$Function.getValues(Map,
IndexReader) â 259,003 17 % â 0 â
â â â â â â â â
â
â â
â â â â â â â
âââ¬âorg.apache.solr.search.function.TopValueSource.getValues(Map,
IndexReader) â 259,003 17 % â 0 â
â â â â â â â â
â
â â
â â â â â â â
ââââorg.apache.solr.search.function.ScaleFloatFunction.getValues(Map,
IndexReader) â 259,003 17 % â 259,003 â
â â â â â â â
â â
â
â â â â â â
ââââorg.apache.lucene.search.BooleanQuery$BooleanWeight.scorer(IndexReader,
boolean, boolean) â 191 0 % â 0 â
â â â â â â
â â
â
â â â â â
ââââorg.apache.lucene.search.FilteredQuery$2.score(Collector)
â 41,044 3 % â 567
â
â â â â â â
â â
â
â â â â â
ââââorg.apache.solr.search.DocSetDelegateCollector.setNextReader(IndexReader,
int) â 24 0 % â 0 â
â â â â â
â â
â
â â â â
ââââorg.apache.lucene.search.IndexSearcher.createNormalizedWeight(Query)
â 4 0 % â
0 â
â â â â
â â
â
â â â
ââââorg.apache.solr.search.DocSetDelegateCollector.<init>(int, int,
Collector) â 20 0 % â
20 â
â â â
â â
â
â â
ââââorg.apache.solr.search.SolrIndexSearcher.getProcessedFilter(DocSet,
List) â 2,586 0 % â
5 â
â â
â â
â
â
ââââorg.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher$QueryResult,
SolrIndexSearcher$QueryCommand) â 362,135 23 % â 0
â
â â
â â
â
â ââââorg.apache.solr.search.SolrIndexSearcher.getDocSet(List)
â 4,325 0 % â
0 â
â â
â â
â
â ââââorg.apache.solr.search.Grouping.execute()
â 3,591 0 % â
0 â
â â
â â
â
â
ââââorg.apache.solr.search.grouping.CommandHandler.processResult(SolrIndexSearcher$QueryResult,
...) â 655 0 % â 0 â
â â
â â
â
â
ââââorg.apache.solr.handler.component.QueryComponent.doFieldSortValues(ResponseBuilder,
SolrIndexSearcher) â 101 0 % â 101 â
â â
â â
â
â ââââorg.apache.solr.search.SolrIndexSearcher.getFirstMatch(Term)
â 10 0 % â
0 â
â
â â
â
â org.apache.solr.handler.component.QueryComponent.prepare(ResponseBuilder)
â 4,811 0 % â
0 â
â
â â
â
â org.apache.solr.handler.component.FacetComponent.process(ResponseBuilder)
â 2,901 0 % â
0 â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ´âââââââââââââââââââââ´ââââââââââââââââââ
Generated by YourKit Java Profiler 10.0.0 08âFebâ2012 16:12:23
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]