[ http://issues.apache.org/jira/browse/LUCENE-651?page=all ]

Otis Gospodnetic updated LUCENE-651:
------------------------------------

    Lucene Fields: [Patch Available]
         Assignee: Otis Gospodnetic

FieldCache bit us in the ass recently, so I'm looking at other FieldCache 
issues.
This one looks good to me
(discussion that led to the patch is at 
http://www.gossamer-threads.com/lists/lucene/java-user/38717 )

Question about this snippet:
+        synchronized (value) {
+          CreationPlaceholder progress = (CreationPlaceholder) value;
+          if (progress.value == null) {
+            progress.value = createValue(reader, key);
+            synchronized (readerCache) {
+              innerCache.put(key, progress.value);
+            }
+          }

Is that synchronization on value really needed here?  Wouldn't synchronizing on 
readerCache be sufficient here?  Something like:

+        synchronized (readerCache) {
+          CreationPlaceholder progress = (CreationPlaceholder) value;
+          if (progress.value == null) {
+            progress.value = createValue(reader, key);
+             innerCache.put(key, progress.value);
+          }

Or would that be too coarse?  Maybe, I see createValue does a fair bit of work.

I'll commit this shortly.

> Poor performance race condition in FieldCacheImpl
> -------------------------------------------------
>
>                 Key: LUCENE-651
>                 URL: http://issues.apache.org/jira/browse/LUCENE-651
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>    Affects Versions: 2.0.0
>            Reporter: Oliver Hutchison
>         Assigned To: Otis Gospodnetic
>            Priority: Minor
>         Attachments: LUCENE-651.patch
>
>
> A race condition exists in FieldCacheImpl that causes a significant 
> performance degradation if multiple threads concurrently request a value that 
> is not yet cached. The degradation is particularly noticable in large indexes 
> and when there a many concurent requests for the cached value.
> For the full discussion see the mailing list thread 'Poor performance "race 
> condition" in FieldSortedHitQueue' 
> (http://www.gossamer-threads.com/lists/lucene/java-user/38717).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to