HappenLee opened a new pull request, #70928:
URL: https://github.com/apache/doris/pull/70928

   ### Background
   
   The native Parquet V2 reader expands PLAIN BOOLEAN values from one bit to 
one byte, in batches of up to 128 values. The fixed-value consumer accepts 
contiguous spans of these bytes.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: None
   PR Type: Performance
   
   Problem Summary:
   
   Dense PLAIN BOOLEAN reads on non-AVX2 builds process every value again after 
batch unpacking. Passing the unpacked spans directly to the consumer reduces 
decoder time by 3.50x to 4.81x on the ARM64 microbenchmark below.
   
   ### Details
   
   - **Why it was slow:** The decoder checked the scratch-buffer cursor for 
every value and copied each value into a stack array before handing the array 
to the consumer.
   - **Optimization:** Refill the existing scratch buffer as needed and pass 
the available contiguous span directly to the consumer. Advance the cursor once 
per span and validate the available input once per request.
   - **Results:** Median of 11 measured rounds on one pinned ARM64 Neoverse N2 
core using `-O3 -march=armv8-a`. The in-memory decoder benchmark reads 100,000 
dense, null-free PLAIN BOOLEAN values in requests of 4,096 values. [ARM64 
benchmark 
run](https://github.com/HappenLee/incubator-doris/actions/runs/45322631720)
   
     | Compiler | Before | After | Speedup |
     |---|---:|---:|---:|
     | Clang 18.1 | 75.84 us | 15.76 us | 4.81x |
     | GCC 14.2 | 78.94 us | 22.52 us | 3.50x |
   
   - **Applicability and cost:** Applies to PLAIN BOOLEAN fixed-value reads on 
builds without `__AVX2__`. An unaligned request may be delivered in multiple 
spans under the existing consumer contract. The decoder reuses its 128-byte 
scratch buffer.
   
   ### Testing
   
   - Four Parquet V2 BOOLEAN tests passed in a local non-AVX2 ASAN build before 
rebasing, including the new regression test for unaligned requests across 
refill boundaries and truncated input.
   - The isolated ARM64 decoder test checked decoded bytes, unaligned input, 
and split requests. The production source patch is identical after rebasing 
onto master.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Partially verified: the full BE unit test binary 
was last run before rebasing onto master.
   
   ### AI Disclosure
   
   - Tool: Codex (GPT-6)
   - Generated: the implementation, regression test, benchmark harness, and PR 
description
   - Human review: not stated
   


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