You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "maxburke (via GitHub)" <gi...@apache.org> on 2023/03/02 16:21:42 UTC

[GitHub] [arrow-rs] maxburke opened a new pull request, #3793: Preallocate buffers for FixedSizeBinary array creation

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

   Closes issue #3792 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] maxburke commented on a diff in pull request #3793: Preallocate buffers for FixedSizeBinary array creation

Posted by "maxburke (via GitHub)" <gi...@apache.org>.
maxburke commented on code in PR #3793:
URL: https://github.com/apache/arrow-rs/pull/3793#discussion_r1123617125


##########
arrow-array/src/array/fixed_size_binary_array.rs:
##########
@@ -234,8 +242,10 @@ impl FixedSizeBinaryArray {
     {
         let mut len = 0;
         let mut byte = 0;
-        let mut null_buf = MutableBuffer::from_len_zeroed(0);
-        let mut buffer = MutableBuffer::from_len_zeroed(0);
+
+        let iter_size_hint = iter.size_hint().0;
+        let mut null_buf = MutableBuffer::from_len_zeroed((iter_size_hint + 7) / 8);

Review Comment:
   Done



##########
arrow-array/src/array/fixed_size_binary_array.rs:
##########
@@ -141,8 +141,11 @@ impl FixedSizeBinaryArray {
         let mut len = 0;
         let mut size = None;
         let mut byte = 0;
-        let mut null_buf = MutableBuffer::from_len_zeroed(0);
+
+        let iter_size_hint = iter.size_hint().0;
+        let mut null_buf = MutableBuffer::from_len_zeroed((iter_size_hint + 7) / 8);

Review Comment:
   Done



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3793: Preallocate buffers for FixedSizeBinary array creation

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #3793:
URL: https://github.com/apache/arrow-rs/pull/3793#discussion_r1123435336


##########
arrow-array/src/array/fixed_size_binary_array.rs:
##########
@@ -234,8 +242,10 @@ impl FixedSizeBinaryArray {
     {
         let mut len = 0;
         let mut byte = 0;
-        let mut null_buf = MutableBuffer::from_len_zeroed(0);
-        let mut buffer = MutableBuffer::from_len_zeroed(0);
+
+        let iter_size_hint = iter.size_hint().0;
+        let mut null_buf = MutableBuffer::from_len_zeroed((iter_size_hint + 7) / 8);

Review Comment:
   I would perhaps expect to see `MutableBuffer::new` here - https://docs.rs/arrow-buffer/latest/arrow_buffer/struct.MutableBuffer.html#method.new?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on pull request #3793: Preallocate buffers for FixedSizeBinary array creation

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #3793:
URL: https://github.com/apache/arrow-rs/pull/3793#issuecomment-1453391612

   I wonder if we also need to update try_from_sparse_iter_with_size?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3793: Preallocate buffers for FixedSizeBinary array creation

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #3793:
URL: https://github.com/apache/arrow-rs/pull/3793#discussion_r1123435780


##########
arrow-array/src/array/fixed_size_binary_array.rs:
##########
@@ -141,8 +141,11 @@ impl FixedSizeBinaryArray {
         let mut len = 0;
         let mut size = None;
         let mut byte = 0;
-        let mut null_buf = MutableBuffer::from_len_zeroed(0);
+
+        let iter_size_hint = iter.size_hint().0;
+        let mut null_buf = MutableBuffer::from_len_zeroed((iter_size_hint + 7) / 8);

Review Comment:
   Can we use bit_util::ceil here instead



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] ursabot commented on pull request #3793: Preallocate buffers for FixedSizeBinary array creation

Posted by "ursabot (via GitHub)" <gi...@apache.org>.
ursabot commented on PR #3793:
URL: https://github.com/apache/arrow-rs/pull/3793#issuecomment-1453406674

   Benchmark runs are scheduled for baseline = f8abb047519e2be6044882ef4469ffcd8b6e7c56 and contender = b9fcd7fa2154f848823521a11aeeba4e687025b8. b9fcd7fa2154f848823521a11aeeba4e687025b8 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/f129e2d705514c9c9b608df618ddf336...157a70544469471394767265ab184a4d/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/b81bc0e3a788489394744a69a4687bf7...e79101a5571a4e89b0ab43d45dd79e67/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/1f38bfdd33a74542877a35329d02aae3...5e6ae60884184cc29da1d4bb82048d44/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/168d2e0688dc4f13929044a7e643150a...9bc026d75de3468c9888460b68a4cf85/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold merged pull request #3793: Preallocate buffers for FixedSizeBinary array creation

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold merged PR #3793:
URL: https://github.com/apache/arrow-rs/pull/3793


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org