Repository navigation
GH-34319: [R] Batch simple attribute restoration for wide tables - #55668
Draft
Aurantium-47 wants to merge 1 commit into
Draft
Aurantium-47 wants to merge 1 commit into
Aurantium-47 wants to merge 1 commit into
Conversation
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.
Rationale for this change
#34319 still exhibits substantial overhead when restoring per-column R attributes on wide tables. The current restoration loop repeatedly replaces individual data-frame columns and repeatedly looks up column names. Reading only a few columns also incurs the separate cost of sanitizing the file's full R metadata; this PR does not alter that safety check.
What changes are included in this PR?
Are these changes tested?
test-metadata.Rfile passes all 105 expectations with the modified R function injected into a conda-forge Arrow R 25.0.1 runtime (R 4.5.3, Linux x86_64).git diff --checkpasses.textandlevelsattributes, same file for both implementations, warmup plus three alternating original/patched repetitions and explicit garbage collection.| Selected columns (of 16,000) | Original median | Patched median | Ratio |
| --- | ---: | ---: | ---: |
| 200 | 1.806 s | 1.767 s | 1.02× |
| 16000 | 22.227 s | 2.674 s | 8.31× |
All-column raw seconds: original
[22.227, 22.876, 21.933], patched[2.768, 2.508, 2.674]. The 200-column difference is small and should be treated as noise, not a demonstrated speedup. This is a synthetic reproduction of the issue, not a general Arrow performance claim.The original and patched R functions are both taken from main at
21156bccc5f3b2eaaa21b9045cccd02ba332f435. The native Arrow library was held constant at 25.0.1; this is not a local build of current-main C++, and a complete current-main package build/test remains for CI. No C++ code changes are included.Are there any user-facing changes?
Faster restoration of simple per-column attributes on wide tables. No API or file-format change. The separate metadata deserialization/sanitization cost remains, so narrow projections should not be expected to receive the same improvement.
Was AI used for this PR?
AI was used for implementation, differential review, tests, local benchmark execution and this description. No human review is claimed.
PR code and description written by:
Reviewed before submission by: