shubhamvishu commented on code in PR #12716:
URL: https://github.com/apache/lucene/pull/12716#discussion_r1370588249


##########
lucene/CHANGES.txt:
##########
@@ -190,6 +190,8 @@ Improvements
 * GITHUB#12705, GITHUB#12705: Improve handling of NullPointerException and 
IllegalStateException
   in MMapDirectory's IndexInputs.  (Uwe Schindler, Michael Sokolov)
 
+* GITHUB#12716: Improve hash mixing in FST's double-barrel LRU hash. (Shubham 
Chaudhary)

Review Comment:
   Changed in the new revision!



##########
lucene/core/src/java/org/apache/lucene/util/fst/NodeHash.java:
##########
@@ -182,8 +183,9 @@ private long hash(FSTCompiler.UnCompiledNode<T> node) {
         h += 17;
       }
     }
-
-    return h;
+    // Here we multiply the hash with the gold constant BitMixer#PHI_C64
+    // This makes a real difference in the evenness of the value distribution
+    return h * BitMixer.PHI_C64;

Review Comment:
   I have added the link on the constant. Its was better to add the link at one 
place(where we declare) than on all usages. 



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to