lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [lucenenet] theolivenbaum opened a new issue #370: Reduce allocations from current FieldCache implementation
Date Sat, 17 Oct 2020 13:00:09 GMT

theolivenbaum opened a new issue #370:
URL: https://github.com/apache/lucenenet/issues/370


   Was doing today some more benchmark on our usage of Lucene, and noticed the current design
of FieldCache allocates an anonymous class due to the method passed [here](https://github.com/apache/lucenenet/blob/37d7ffdede8918f3bce728647f438de47bd229be/src/Lucene.Net/Search/FieldCacheImpl.cs#L1347):
   
   `````csharp
   NumericDocValues valuesIn = reader.GetNumericDocValues(field);
   if (valuesIn != null)
   {
       // Not cached here by FieldCacheImpl (cached instead
       // per-thread by SegmentReader):
       return new FieldCache.Int64s(get: (docID) => valuesIn.Get(docID));
   }
   `````
   
   In our usage of Lucene, we end up hitting this quite often, as you can see on the trace:
   ![image](https://user-images.githubusercontent.com/8791811/96337735-5f473c00-1089-11eb-880d-1aa849ff7ce6.png)
   
   
   
   I'll investigate if there is any quick win here, and open a PR if so.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message