⚡ Bolt: Add fast path for single batch build side in HashJoin#262
⚡ Bolt: Add fast path for single batch build side in HashJoin#262
Conversation
💡 What: Adds a fast path to the `collect_left_input` function in `HashJoinExec`. If the build-side input stream consists of a single `RecordBatch`, this change avoids calling `concat_batches` and uses the batch directly. 🎯 Why: The `concat_batches` function can be expensive, requiring new memory allocations and data copies. When the build side is already a single batch (a common case), this operation is unnecessary overhead. 📊 Impact: Improves hash join performance and reduces memory allocation for joins where the build side is a single batch. 🔬 Measurement: The correctness of this change is verified by the existing test suite (`cargo test -p datafusion-physical-plan`). The performance improvement is a micro-optimization that would be visible in targeted benchmarks. Co-authored-by: Dandandan <163737+Dandandan@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR introduces a performance optimization to the
HashJoinExecoperator. It adds a fast path to avoid an unnecessaryconcat_batchescall when the build side of the join consists of a singleRecordBatch, thereby reducing memory allocation and CPU overhead in this common scenario.PR created automatically by Jules for task 17536242971790051292 started by @Dandandan