perf: Reduce record batch memory accounting overhead - #24319
Open
ryux1 wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24319 +/- ##
========================================
Coverage 81.14% 81.15%
========================================
Files 1110 1110
Lines 386137 386377 +240
Branches 386137 386377 +240
========================================
+ Hits 313347 313569 +222
- Misses 54324 54340 +16
- Partials 18466 18468 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
Record batch memory accounting runs on hot execution paths. The current implementation materializes ArrayData for every array and allocates a hash set even for small batches, adding measurable overhead to queries that frequently update memory reservations.
What changes are included in this PR?
Criterion point estimates from cargo bench -p datafusion-common --bench record_batch_memory, measured in isolated target directories on the same machine:
Are these changes tested?
Yes.
Are there any user-facing changes?
No API or behavior changes. This reduces CPU and allocation overhead in record batch memory accounting.
AI assistance: OpenAI Codex assisted with implementation and test execution. I reviewed the change and its behavior end to end.