lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grotzke <>
Subject Re: How to read values of a field efficiently
Date Tue, 24 Jul 2007 11:21:56 GMT
On Mon, 2007-07-23 at 23:32 -0700, Chris Hostetter wrote:
> : This part (reading field values) takes fairly long compared
> : to the other fields (that use getFacetTermEnumCounts or
> : getFieldCacheCounts as implemented in SimpleFacets), so that
> : I asume that there is potential for optimization.
> :
> : Fairly long: getFieldCacheCounts for the cat field takes ~70 ms
> : for the second request, while reading prices takes ~600 ms.
> using the ValueSource from the field should be roughly as fast as using
> the FieldCache since it's backed by the fieldcache ... 
Ok, I didn't know that.

> allthough a few
> things jump out at me as kind of odd...
> 1) why ask for hte float value and then cast it to int?
You're right, I just changed this, unfortunately it doesn't save time...

> 2) what is a TIntArrayList and what kind of overhead does calling add have?
A list implementation for primitive int values, but I tested this before
and there's no measurable overhead.
I already changed this to a primitive int[] array, also no time savings.

> 3) if getFieldCacheCounts is fast enough, why not based your code on that
>    instead of getting the ValueSource?
I just tried this, and mostly (but not always) it's faster than going
through the ValueSource. For this I have to adjust my range calculation
and check if this is faster/slower then.

Is it possible to get the values from the ValueSource (or from
getFieldCacheCounts) sorted by its natural order (from lowest to
highest values)?

If this would not take much more time, I wouldn't need to sort
the values by myself (what I do for range calculation) which takes
also a fairly amount of time (mostly as much as getting values from
ValueSource and sometimes even more).

Thanx for your help,

> -Hoss

View raw message