You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/09/28 16:35:03 UTC

[GitHub] [lucene] msokolov commented on a change in pull request #322: LUCENE-10125: Speed up computation of exceptions.

msokolov commented on a change in pull request #322:
URL: https://github.com/apache/lucene/pull/322#discussion_r717756811



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene90/PForUtil.java
##########
@@ -59,24 +60,30 @@ static boolean allEqual(long[] l) {
   /** Encode 128 integers from {@code longs} into {@code out}. */
   void encode(long[] longs, DataOutput out) throws IOException {
     // Determine the top MAX_EXCEPTIONS + 1 values
-    final long[] top = new long[MAX_EXCEPTIONS + 1];
-    Arrays.fill(top, -1L);
-    for (int i = 0; i < ForUtil.BLOCK_SIZE; ++i) {
-      if (longs[i] > top[0]) {
-        top[0] = longs[i];
-        Arrays.sort(
-            top); // For only a small number of entries we just sort on every iteration instead of
-        // maintaining a PQ
+    final LongHeap top = LongHeap.create(LongHeap.Order.MIN, MAX_EXCEPTIONS + 1);

Review comment:
       exciting that this is finding new uses :)




-- 
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-unsubscribe@lucene.apache.org

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



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