You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "wForget (via GitHub)" <gi...@apache.org> on 2026/09/08 05:01:40 UTC

[PR] [Improvement] Avoid repeated cleanup scans in DecompressionWorker [uniffle]

wForget opened a new pull request, #2787:
URL: https://github.com/apache/uniffle/pull/2787

   ### What changes were proposed in this pull request?
   
   `DecompressionWorker.get()` scans all previous batch and segment indices on every block read, even after their entries have been removed. Sequentially consuming a batch of N blocks therefore performs `N(N−1)/2` redundant segment removals.
   
   This PR tracks batch and segment cleanup progress so that subsequent reads only clean newly skipped indices. The segment cursor resets when advancing to another batch, preserving skipped-block cleanup and permit release behavior.
   
   ### Why are the changes needed?
   
   Repeated cleanup causes quadratic overhead when overlapping decompression is enabled and a reader processes many blocks or batches. Tracking cleanup progress makes total cleanup work linear for sequential consumption.
   
   closes #2786
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   - Added a test covering skipped segments, batch transitions, and permit release.
   - All 6 tests in `DecompressionWorkerTest` passed.
   - Compared `org.apache.uniffle.client.impl.DecompressionWorkerTest#testGetPerformance` with and without the fix. The test waits for decompression to finish before timing sequential `get()` calls.
   
   Without the fix:
   
   ```text
   DecompressionWorker.get: blocks=1000, elapsed=5.381 ms
   DecompressionWorker.get: blocks=100000, elapsed=13470.841 ms
   ```
   
   With the fix:
   
   ```text
   DecompressionWorker.get: blocks=1000, elapsed=1.139 ms
   DecompressionWorker.get: blocks=100000, elapsed=8.458 ms
   ```
   
   For 100,000 blocks, retrieval time decreased from approximately **13.47 seconds to 8.46 milliseconds** in this local test.
   


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

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


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


Re: [PR] [#2786] improvement(client): Avoid repeated cleanup scans in DecompressionWorker [uniffle]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2787:
URL: https://github.com/apache/uniffle/pull/2787#issuecomment-5580021194

   ## Test Results
    3 833 files  ± 0   3 833 suites  ±0   8h 6m 31s ⏱️ - 3m 18s
    1 267 tests + 1   1 256 ✅ + 1  11 💤 ±0  0 ❌ ±0 
   19 174 runs  +18  19 126 ✅ +18  48 💤 ±0  0 ❌ ±0 
   
   Results for commit 940d7e11. ± Comparison against base commit dfeeb16e.
   
   [test-results]:data:application/gzip;base64,H4sIAJmjn2oC/03NTQ6DIBRG0a0Yxh3wAMHXzRhBSEj9aRBGpnsvWqUMvwNcduL8ZDfybHjH+aMhW/Kx3mMKQ/TrkoUhIGTK5/G4AUyqe/ZbMua0Vv7t5d+HlUe9G/yUhRawIazhkpCWM4ugxDVLFvNnxX5Z0d1QVc9dR806zz7mQVDQUVkAqmXrLOMoHNXgnEbKW5BMC6PZaDry+QKo+GszFQEAAA==
   


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

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


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


Re: [PR] [#2786] improvement(client): Avoid repeated cleanup scans in DecompressionWorker [uniffle]

Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston merged PR #2787:
URL: https://github.com/apache/uniffle/pull/2787


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

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


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


Re: [PR] [#2786] improvement(client): Avoid repeated cleanup scans in DecompressionWorker [uniffle]

Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on code in PR #2787:
URL: https://github.com/apache/uniffle/pull/2787#discussion_r3954946902


##########
client/src/test/java/org/apache/uniffle/client/impl/DecompressionWorkerTest.java:
##########
@@ -124,4 +124,39 @@ public void test() throws Exception {
     DecompressedShuffleBlock block1 = worker.get(0, 1);
     assertEquals(100, block1.getByteBuffer().remaining());
   }
+
+  @Test
+  public void testGetPerformance() {

Review Comment:
   Please remove this test, this is just the micro-benchmark. 



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

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


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


Re: [PR] [#2786] improvement(client): Avoid repeated cleanup scans in DecompressionWorker [uniffle]

Posted by "wForget (via GitHub)" <gi...@apache.org>.
wForget commented on code in PR #2787:
URL: https://github.com/apache/uniffle/pull/2787#discussion_r3955112118


##########
client/src/test/java/org/apache/uniffle/client/impl/DecompressionWorkerTest.java:
##########
@@ -124,4 +124,39 @@ public void test() throws Exception {
     DecompressedShuffleBlock block1 = worker.get(0, 1);
     assertEquals(100, block1.getByteBuffer().remaining());
   }
+
+  @Test
+  public void testGetPerformance() {

Review Comment:
   Thanks, removed



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

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


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