dweiss commented on code in PR #16746:
URL: https://github.com/apache/lucene/pull/16746#discussion_r4452168388


##########
lucene/core/src/java/org/apache/lucene/util/compress/LZ4.java:
##########
@@ -133,6 +133,10 @@ public static int decompress(DataInput compressed, int 
decompressedLen, byte[] d
       // copying a multiple of 8 bytes can make decompression from 5% to 10% 
faster
       final int fastLen = (matchLen + 7) & 0xFFFFFFF8;
       if (matchDec < matchLen || dOff + fastLen > destEnd) {
+        if (matchLen >= 274 && matchDec < matchLen) {

Review Comment:
   Can we extract this 274 to a constant, with some explanation that it was 
arrived at experimentally (and a link to this issue)?



##########
lucene/CHANGES.txt:
##########
@@ -19,6 +19,9 @@ Improvements
 
 Optimizations
 ---------------------
+* GITHUB#16746: Speed up decoding long overlapping LZ4 matches using bulk 
copies
+  of initialized bytes. (Andre Kurait)
+

Review Comment:
   This should go into 11x and main, I think? If so, move the entry to 11x



##########
lucene/core/src/test/org/apache/lucene/util/compress/TestDecompressLZ4.java:
##########
@@ -18,9 +18,54 @@
 
 import java.io.IOException;
 import org.apache.lucene.store.ByteArrayDataInput;
+import org.apache.lucene.store.ByteBuffersDataOutput;
 import org.apache.lucene.tests.util.LuceneTestCase;
+import org.apache.lucene.util.ArrayUtil;
 
 public class TestDecompressLZ4 extends LuceneTestCase {
+  public void testOverlappingMatchesWithDictionaryAndPartialReads() throws 
IOException {

Review Comment:
   I don't think any human being other than just a bunch of lz4 enthusiasts can 
follow this test but I trust it's fine in these times.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to