comphead opened a new pull request, #26192:
URL: https://github.com/apache/datafusion/pull/26192

   ## Which issue does this PR close?
   
   - N/A
   
   ## Rationale for this change
   
   Many execution paths allocate more than they need. Collections start empty 
although their final size is known, and some temporaries are allocated again on 
every row, batch, partition or column. Each case is small, but together they 
add avoidable allocator traffic on hot paths.
   
   ## What changes are included in this PR?
   
   Two mechanical rules applied across the workspace:
   - `with_capacity` where the size is known or tightly bounded by in-memory 
data.
   - Per-iteration temporaries hoisted out of loops and reused with `clear()` 
when they don't escape the iteration.
   
   For example, `RepartitionExec` no longer allocates a `Vec` per batch per 
output partition, `TDigest` merging reuses one buffer instead of a full-size 
`Vec` per merge step, and hive-partitioned writes no longer build a 
`Vec<String>` key per row.
   
   ## What is the testing strategy for this PR?
   
   No behavior change, so existing tests cover it. The workspace `--lib --tests 
--bins` suite and sqllogictest pass locally. Criterion benches against `main` 
(`regexp_replace`, `reverse`, `array_slice`, `bounded_window`) are neutral to a 
few percent faster.
   
   ## Are there any user-facing changes?
   
   No.
   


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