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