lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shad Storhaug (Jira)" <>
Subject [jira] [Commented] (LUCENENET-610) Reduce locking in FieldCacheImpl::Cache::Get
Date Mon, 30 Sep 2019 17:18:00 GMT


Shad Storhaug commented on LUCENENET-610:

Thanks for the report. Could you please provide a reproduction case, either in the form of
an integration test or a console app?

> Reduce locking in FieldCacheImpl::Cache::Get
> --------------------------------------------
>                 Key: LUCENENET-610
>                 URL:
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Core
>    Affects Versions: Lucene.Net 4.8.0
>            Reporter: Thomas Mathew
>            Priority: Minor
> We noticed a lot of contention in FieldCacheImpl::Cache::Get (our queries use a lot
of query time joins + sorting, so we hit the field cache a lot).
> We use a SearcherManager with warm-up queries to populate the field cache so we would
expect it to be initialized in most cases before we hit it for actual requests.
> The implementation seems to lock even for the happy path (when everything's already initialized).
This seems like a by-product of the choice of data structures (the underlying WeakDictionary,
WeakHashMap etc are not threadsafe) and so the locking is required in case the dictionary
gets resized.
> Ideally we could be using thread-safe data structures and only lock when initializing
the data.

This message was sent by Atlassian Jira

View raw message