Re: [PR] perf: Avoid ArrayData allocation in PrimitiveArray::reinterpret_cast [arrow-rs]

2026-01-11 Thread via GitHub


alamb merged PR #9129:
URL: https://github.com/apache/arrow-rs/pull/9129


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



Re: [PR] perf: Avoid ArrayData allocation in PrimitiveArray::reinterpret_cast [arrow-rs]

2026-01-11 Thread via GitHub


alamb commented on PR #9129:
URL: https://github.com/apache/arrow-rs/pull/9129#issuecomment-3734487908

   Thanks @Jefffrey and @scovich 


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



Re: [PR] perf: Avoid ArrayData allocation in PrimitiveArray::reinterpret_cast [arrow-rs]

2026-01-09 Thread via GitHub


alamb commented on code in PR #9129:
URL: https://github.com/apache/arrow-rs/pull/9129#discussion_r2677663601


##
arrow-array/src/array/primitive_array.rs:
##
@@ -859,11 +859,9 @@ impl PrimitiveArray {
 where
 K: ArrowPrimitiveType,
 {
-let d = self.to_data().into_builder().data_type(K::DATA_TYPE);
-
 // SAFETY:
 // Native type is the same
-PrimitiveArray::from(unsafe { d.build_unchecked() })
+PrimitiveArray::new(self.values.clone(), self.nulls.clone())

Review Comment:
   Bonus points that it removes some `unsafe`



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



[PR] perf: Avoid ArrayData allocation in PrimitiveArray::reinterpret_cast [arrow-rs]

2026-01-09 Thread via GitHub


alamb opened a new pull request, #9129:
URL: https://github.com/apache/arrow-rs/pull/9129

   # Which issue does this PR close?
   
   - part of https://github.com/apache/arrow-rs/issues/9128
   
   # Rationale for this change
   
   While studying / profiling the Parquet reader I have noticed several places 
where unecessary allocations are happening
   
   # What changes are included in this PR?
   
   Avoid ArrayData allocation in `PrimitiveArray::reinterpret_cast`
   
   # Are these changes tested?
   
   
   
   # Are there any user-facing changes?
   
   
   


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