parthchandra commented on code in PR #727:
URL: https://github.com/apache/datafusion-comet/pull/727#discussion_r1699268566
##########
native/core/src/common/bit.rs:
##########
@@ -145,7 +145,9 @@ macro_rules! read_num_be_bytes {
#[inline]
pub fn memcpy(source: &[u8], target: &mut [u8]) {
debug_assert!(target.len() >= source.len(), "Copying from source to target
is not possible. Source has {} bytes but target has {} bytes", source.len(),
target.len());
- target[..source.len()].copy_from_slice(source)
+ // Originally `target[..source.len()].copy_from_slice(source)`
+ // We use the unsafe copy method to avoid some expensive bounds checking/
+ unsafe { std::ptr::copy_nonoverlapping(source.as_ptr(),
target.as_mut_ptr(), source.len()) }
Review Comment:
Before this
`scan decimal (spark) : 1.0x`
`scan decimal (Comet, decimal 128) : 0.4x`
After
`scan decimal (Comet, decimal 128) : 0.5x`
So a small improvement.
--
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]