Edarke commented on PR #13581:
URL: https://github.com/apache/lucene/pull/13581#issuecomment-2239723532

   @msokolov Sorry to interject, but the hash function `Objects.hash(level, 
node) % NUM_LOCKS;` seems like it is prone to lock contention if workers have 
power of 2 offsets. Would it be worthwhile to avoid the `Integer[]` allocation 
and smear the hash instead?
   
   ```java
   private static int hash(int level, int node) {
      int h = level * 31 + node; 
      h ^= (h >>> 20) ^ (h >>> 12);
      return h ^ (h >>> 7) ^ (h >>> 4);
    }
   
   ```


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