tustvold commented on a change in pull request #1248:
URL: https://github.com/apache/arrow-rs/pull/1248#discussion_r799323599
##########
File path: arrow/src/buffer/mutable.rs
##########
@@ -475,35 +475,36 @@ impl MutableBuffer {
let (_, upper) = iterator.size_hint();
let upper = upper.expect("from_trusted_len_iter requires an upper
limit");
- let mut result = {
- let byte_capacity: usize = upper.saturating_add(7) / 8;
- MutableBuffer::new(byte_capacity)
- };
+ let aligned_len = bit_util::ceil(upper, 64) * 8;
+ let mut result = MutableBuffer::new(aligned_len);
'a: loop {
- let mut byte_accum: u8 = 0;
- let mut mask: u8 = 1;
+ let mut accum: u64 = 0;
Review comment:
I was sure this improved the benchmarks at one point, but it would
appear to now make them worse :scream:
Great catch :+1:
--
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]