You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2014/04/23 16:14:25 UTC

svn commit: r1589422 - in /lucene/dev/branches/branch_4x: ./ lucene/core/src/java/org/apache/lucene/search/Weight.java

Author: mikemccand
Date: Wed Apr 23 14:14:24 2014
New Revision: 1589422

URL: http://svn.apache.org/r1589422
Log:
LUCENE-5487: add comment explaining hotspot voodoo

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/search/Weight.java

Modified: lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/search/Weight.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/search/Weight.java?rev=1589422&r1=1589421&r2=1589422&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/search/Weight.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/search/Weight.java Wed Apr 23 14:14:24 2014
@@ -170,7 +170,11 @@ public abstract class Weight {
         return scoreRange(collector, scorer, doc, max);
       }
     }
-    
+
+    /** Specialized method to bulk-score a range of hits; we
+     *  separate this from {@link #scoreAll} to help out
+     *  hotspot.
+     *  See <a href="https://issues.apache.org/jira/browse/LUCENE-5487">LUCENE-5487</a> */
     static boolean scoreRange(Collector collector, Scorer scorer, int currentDoc, int end) throws IOException {
       while (currentDoc < end) {
         collector.collect(currentDoc);
@@ -179,6 +183,10 @@ public abstract class Weight {
       return currentDoc != DocIdSetIterator.NO_MORE_DOCS;
     }
     
+    /** Specialized method to bulk-score all hits; we
+     *  separate this from {@link #scoreRange} to help out
+     *  hotspot.
+     *  See <a href="https://issues.apache.org/jira/browse/LUCENE-5487">LUCENE-5487</a> */
     static void scoreAll(Collector collector, Scorer scorer) throws IOException {
       int doc;
       while ((doc = scorer.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {