You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "liamzwbao (via GitHub)" <gi...@apache.org> on 2025/07/24 00:56:52 UTC
[PR] Use Vec directly in generic_bytes_builder [arrow-rs]
liamzwbao opened a new pull request, #7984:
URL: https://github.com/apache/arrow-rs/pull/7984
# Which issue does this PR close?
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax.
- Closes #NNN.
# Rationale for this change
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
# What changes are included in this PR?
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
# Are these changes tested?
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
# Are there any user-facing changes?
If there are user-facing changes then we may require documentation to be updated before approving the PR.
If there are any breaking changes to public APIs, please call them out.
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "liamzwbao (via GitHub)" <gi...@apache.org>.
liamzwbao commented on PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#issuecomment-3123627002
Hi @jhorstmann @Dandandan, thank you very much for the review! I have addressed the comments.
However, I noticed that this implementation will fail some tests because the capacity of `Vec` does not round up to multiple of 64 like [MutableBuffer](https://github.com/apache/arrow-rs/blob/16794ab14fa62ecf67de0da9460cc5752a9358f4/arrow-buffer/src/buffer/mutable.rs#L88) does. I have updated the tests in this PR for reference. Would appreciate suggestions to address this issue.
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#discussion_r2257434358
##########
arrow-select/src/concat.rs:
##########
@@ -1328,12 +1328,12 @@ mod tests {
let a = concat(&[&a, &b]).unwrap();
let data = a.to_data();
assert_eq!(data.buffers()[0].len(), 440);
- assert_eq!(data.buffers()[0].capacity(), 448); // Nearest multiple of 64
+ assert_eq!(data.buffers()[0].capacity(), 440); // Nearest multiple of 64
Review Comment:
these comments no longer seem correct, but the tests seem to be an 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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#issuecomment-3160514284
🤖 `./gh_compare_arrow.sh` [Benchmark Script](https://github.com/alamb/datafusion-benchmarking/blob/main/gh_compare_arrow.sh) Running
Linux aal-dev 6.11.0-1016-gcp #16~24.04.1-Ubuntu SMP Wed May 28 02:40:52 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing issue-7383 (e0e2da9f60cfd06ea642afce793c48e64652876c) to 16794ab14fa62ecf67de0da9460cc5752a9358f4 [diff](https://github.com/apache/arrow-rs/compare/16794ab14fa62ecf67de0da9460cc5752a9358f4..e0e2da9f60cfd06ea642afce793c48e64652876c)
BENCH_NAME=filter_kernel
BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental --bench filter_kernel
BENCH_FILTER=
BENCH_BRANCH_NAME=issue-7383
Results will be posted here when complete
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on code in PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#discussion_r2227955629
##########
arrow-array/src/builder/generic_bytes_builder.rs:
##########
@@ -67,8 +67,8 @@ impl<T: ByteArrayType> GenericByteBuilder<T> {
value_buffer: MutableBuffer,
null_buffer: Option<MutableBuffer>,
) -> Self {
- let offsets_builder = BufferBuilder::<T::Offset>::new_from_buffer(offsets_buffer);
- let value_builder = BufferBuilder::<u8>::new_from_buffer(value_buffer);
+ let offsets_builder = Vec::from(offsets_buffer.typed_data::<T::Offset>());
+ let value_builder = Vec::from(value_buffer.as_slice());
Review Comment:
This seems it does a copy?
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "liamzwbao (via GitHub)" <gi...@apache.org>.
liamzwbao commented on code in PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#discussion_r2227242196
##########
arrow-array/src/builder/primitive_builder.rs:
##########
@@ -296,7 +297,7 @@ impl<T: ArrowPrimitiveType> PrimitiveBuilder<T> {
.expect("append_trusted_len_iter requires an upper bound");
self.null_buffer_builder.append_n_non_nulls(len);
- self.values_builder.append_trusted_len_iter(iter);
+ self.values_builder.extend(iter);
Review Comment:
There is no 100% matched function for `Vec` that will check the upper bound of the iter. But this function already check the upper bound of size_hint on line 294, I think it's okay to replace it with `extend` directly
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "jhorstmann (via GitHub)" <gi...@apache.org>.
jhorstmann commented on code in PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#discussion_r2227776952
##########
arrow-array/src/builder/primitive_builder.rs:
##########
@@ -296,7 +297,7 @@ impl<T: ArrowPrimitiveType> PrimitiveBuilder<T> {
.expect("append_trusted_len_iter requires an upper bound");
self.null_buffer_builder.append_n_non_nulls(len);
- self.values_builder.append_trusted_len_iter(iter);
+ self.values_builder.extend(iter);
Review Comment:
If the `iter` actually implements the stdlib internal [`TrustedLen`](https://doc.rust-lang.org/std/iter/trait.TrustedLen.html) trait then this should get nicely optimized. The only caller inside the codebase seems to be in `arrow-select` with a Range iterator, which implements that trait.
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on code in PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#discussion_r2227961239
##########
arrow-array/src/builder/primitive_builder.rs:
##########
@@ -162,7 +162,7 @@ impl<T: ArrowPrimitiveType> PrimitiveBuilder<T> {
values_buffer: MutableBuffer,
null_buffer: Option<MutableBuffer>,
) -> Self {
- let values_builder = BufferBuilder::<T::Native>::new_from_buffer(values_buffer);
+ let values_builder = Vec::from(values_buffer.typed_data::<T::Native>());
Review Comment:
Does a copy?
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "liamzwbao (via GitHub)" <gi...@apache.org>.
liamzwbao commented on PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#issuecomment-3148839028
> Are there any benchmarks that would be good for me to run for this PR?
I think arrow-array is a good candidate
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "jhorstmann (via GitHub)" <gi...@apache.org>.
jhorstmann commented on code in PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#discussion_r2227758149
##########
arrow-array/src/builder/fixed_size_binary_builder.rs:
##########
@@ -89,15 +89,15 @@ impl FixedSizeBinaryBuilder {
#[inline]
pub fn append_null(&mut self) {
self.values_builder
- .append_slice(&vec![0u8; self.value_length as usize][..]);
+ .extend_from_slice(&vec![0u8; self.value_length as usize][..]);
Review Comment:
You can avoid the temporary `Vec` now by using `values_builder.resize(values_builder.len() + value_length, 0_u8)` or `values_builder.extend(std::iter::repeat_n(0_u8, len)`
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "liamzwbao (via GitHub)" <gi...@apache.org>.
liamzwbao commented on code in PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#discussion_r2233428107
##########
arrow-array/src/builder/generic_bytes_builder.rs:
##########
@@ -67,8 +67,8 @@ impl<T: ByteArrayType> GenericByteBuilder<T> {
value_buffer: MutableBuffer,
null_buffer: Option<MutableBuffer>,
) -> Self {
- let offsets_builder = BufferBuilder::<T::Offset>::new_from_buffer(offsets_buffer);
- let value_builder = BufferBuilder::<u8>::new_from_buffer(value_buffer);
+ let offsets_builder = Vec::from(offsets_buffer.typed_data::<T::Offset>());
+ let value_builder = Vec::from(value_buffer.as_slice());
Review Comment:
Replace it with ScalarBuffer instead
##########
arrow-array/src/builder/generic_bytes_builder.rs:
##########
@@ -67,8 +67,8 @@ impl<T: ByteArrayType> GenericByteBuilder<T> {
value_buffer: MutableBuffer,
null_buffer: Option<MutableBuffer>,
) -> Self {
- let offsets_builder = BufferBuilder::<T::Offset>::new_from_buffer(offsets_buffer);
- let value_builder = BufferBuilder::<u8>::new_from_buffer(value_buffer);
+ let offsets_builder = Vec::from(offsets_buffer.typed_data::<T::Offset>());
+ let value_builder = Vec::from(value_buffer.as_slice());
Review Comment:
Replace it with `ScalarBuffer` 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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#issuecomment-3145340835
Are there any benchmarks that would be good for me to run for this PR?
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#issuecomment-3160568048
🤖: Benchmark completed
<details><summary>Details</summary>
<p>
```
group issue-7383 main
----- ---------- ----
array_from_vec 128 1.00 152.0±0.34ns ? ?/sec 1.01 153.8±0.30ns ? ?/sec
array_from_vec 256 1.00 161.0±1.43ns ? ?/sec 1.01 162.6±0.26ns ? ?/sec
array_from_vec 512 1.00 212.4±0.41ns ? ?/sec 1.00 212.6±0.23ns ? ?/sec
array_string_from_vec 128 1.00 1115.8±1.52ns ? ?/sec 1.09 1217.6±2.62ns ? ?/sec
array_string_from_vec 256 1.00 1939.2±2.78ns ? ?/sec 1.07 2.1±0.00µs ? ?/sec
array_string_from_vec 512 1.00 3.3±0.00µs ? ?/sec 1.02 3.4±0.01µs ? ?/sec
decimal128_array_from_vec 32768 1.00 99.2±0.50µs ? ?/sec 1.00 99.1±0.22µs ? ?/sec
decimal256_array_from_vec 32768 1.00 3.8±0.02µs ? ?/sec 1.00 3.9±0.02µs ? ?/sec
struct_array_from_vec 1024 1.01 8.8±0.02µs ? ?/sec 1.00 8.7±0.02µs ? ?/sec
struct_array_from_vec 128 1.02 1941.8±5.96ns ? ?/sec 1.00 1894.6±3.08ns ? ?/sec
struct_array_from_vec 256 1.00 2.9±0.01µs ? ?/sec 1.03 2.9±0.01µs ? ?/sec
struct_array_from_vec 512 1.00 4.8±0.01µs ? ?/sec 1.00 4.8±0.01µs ? ?/sec
```
</p>
</details>
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "liamzwbao (via GitHub)" <gi...@apache.org>.
liamzwbao commented on PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#issuecomment-3111830811
Hi @alamb and @Dandandan, this PR is ready for review. I have changed the implementation to use `Vec` in a few builders. Not sure if some of them are not appropriate to migrate to this new implementation.
Have tested the performance for arrow-array locally, half improved half regressed.
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on code in PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#discussion_r2227956335
##########
arrow-array/src/builder/generic_bytes_builder.rs:
##########
@@ -126,15 +127,16 @@ impl<T: ByteArrayType> GenericByteBuilder<T> {
#[inline]
pub fn append_null(&mut self) {
self.null_buffer_builder.append(false);
- self.offsets_builder.append(self.next_offset());
+ self.offsets_builder.push(self.next_offset());
}
/// Appends `n` `null`s into the builder.
#[inline]
pub fn append_nulls(&mut self, n: usize) {
self.null_buffer_builder.append_n_nulls(n);
let next_offset = self.next_offset();
- self.offsets_builder.append_n(n, next_offset);
+ self.offsets_builder
+ .extend(std::iter::repeat(next_offset).take(n));
Review Comment:
`repeat_n`?
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#issuecomment-3160550257
🤖 `./gh_compare_arrow.sh` [Benchmark Script](https://github.com/alamb/datafusion-benchmarking/blob/main/gh_compare_arrow.sh) Running
Linux aal-dev 6.11.0-1016-gcp #16~24.04.1-Ubuntu SMP Wed May 28 02:40:52 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing issue-7383 (e0e2da9f60cfd06ea642afce793c48e64652876c) to 16794ab14fa62ecf67de0da9460cc5752a9358f4 [diff](https://github.com/apache/arrow-rs/compare/16794ab14fa62ecf67de0da9460cc5752a9358f4..e0e2da9f60cfd06ea642afce793c48e64652876c)
BENCH_NAME=array_from_vec
BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental --bench array_from_vec
BENCH_FILTER=
BENCH_BRANCH_NAME=issue-7383
Results will be posted here when complete
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "liamzwbao (via GitHub)" <gi...@apache.org>.
liamzwbao commented on code in PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#discussion_r2261594366
##########
arrow-select/src/concat.rs:
##########
@@ -1328,12 +1328,12 @@ mod tests {
let a = concat(&[&a, &b]).unwrap();
let data = a.to_data();
assert_eq!(data.buffers()[0].len(), 440);
- assert_eq!(data.buffers()[0].capacity(), 448); // Nearest multiple of 64
+ assert_eq!(data.buffers()[0].capacity(), 440); // Nearest multiple of 64
Review Comment:
Removed outdated comments
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#issuecomment-3160514472
🤖 `./gh_compare_arrow.sh` [Benchmark Script](https://github.com/alamb/datafusion-benchmarking/blob/main/gh_compare_arrow.sh) Running
Linux aal-dev 6.11.0-1016-gcp #16~24.04.1-Ubuntu SMP Wed May 28 02:40:52 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing issue-7383 (e0e2da9f60cfd06ea642afce793c48e64652876c) to 16794ab14fa62ecf67de0da9460cc5752a9358f4 [diff](https://github.com/apache/arrow-rs/compare/16794ab14fa62ecf67de0da9460cc5752a9358f4..e0e2da9f60cfd06ea642afce793c48e64652876c)
BENCH_NAME=take_kernels
BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental --bench take_kernels
BENCH_FILTER=
BENCH_BRANCH_NAME=issue-7383
Results will be posted here when complete
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#issuecomment-3160550033
🤖: Benchmark completed
<details><summary>Details</summary>
<p>
```
group issue-7383 main
----- ---------- ----
take bool 1024 1.00 1384.7±3.74ns ? ?/sec 1.01 1400.1±6.37ns ? ?/sec
take bool 512 1.00 721.0±0.61ns ? ?/sec 1.00 719.6±1.01ns ? ?/sec
take bool null indices 1024 1.00 1167.4±3.40ns ? ?/sec 1.10 1285.8±8.48ns ? ?/sec
take bool null values 1024 1.00 2.9±0.01µs ? ?/sec 1.00 2.9±0.01µs ? ?/sec
take bool null values null indices 1024 1.00 2.3±0.01µs ? ?/sec 1.01 2.3±0.01µs ? ?/sec
take check bounds i32 1024 1.00 1184.4±14.89ns ? ?/sec 1.07 1270.7±2.73ns ? ?/sec
take check bounds i32 512 1.00 719.5±5.20ns ? ?/sec 1.01 726.0±0.97ns ? ?/sec
take i32 1024 1.02 707.1±1.17ns ? ?/sec 1.00 692.8±6.76ns ? ?/sec
take i32 512 1.01 439.2±1.13ns ? ?/sec 1.00 436.0±0.84ns ? ?/sec
take i32 null indices 1024 1.03 826.9±1.52ns ? ?/sec 1.00 801.4±1.31ns ? ?/sec
take i32 null values 1024 1.03 2.1±0.00µs ? ?/sec 1.00 2.1±0.00µs ? ?/sec
take i32 null values null indices 1024 1.08 2.1±0.00µs ? ?/sec 1.00 1931.8±3.39ns ? ?/sec
take primitive fsb value len: 12, indices: 1024 1.05 8.4±0.02µs ? ?/sec 1.00 8.0±0.03µs ? ?/sec
take primitive fsb value len: 12, null values, indices: 1024 1.02 9.8±0.12µs ? ?/sec 1.00 9.6±0.09µs ? ?/sec
take primitive run logical len: 1024, physical len: 512, indices: 1024 1.01 20.4±0.10µs ? ?/sec 1.00 20.2±0.13µs ? ?/sec
take str 1024 1.00 11.1±0.06µs ? ?/sec 1.01 11.2±0.05µs ? ?/sec
take str 512 1.02 5.5±0.02µs ? ?/sec 1.00 5.4±0.01µs ? ?/sec
take str null indices 1024 1.12 7.8±0.03µs ? ?/sec 1.00 7.0±0.03µs ? ?/sec
take str null indices 512 1.10 3.8±0.01µs ? ?/sec 1.00 3.5±0.01µs ? ?/sec
take str null values 1024 1.00 8.8±0.07µs ? ?/sec 1.02 9.0±0.05µs ? ?/sec
take str null values null indices 1024 1.02 7.0±0.02µs ? ?/sec 1.00 6.9±0.02µs ? ?/sec
take stringview 1024 1.00 842.8±1.52ns ? ?/sec 1.01 850.1±1.56ns ? ?/sec
take stringview 512 1.01 477.2±0.92ns ? ?/sec 1.00 472.7±1.03ns ? ?/sec
take stringview null indices 1024 1.00 1400.5±22.78ns ? ?/sec 1.01 1414.5±24.00ns ? ?/sec
take stringview null indices 512 1.00 685.0±2.01ns ? ?/sec 1.01 693.7±3.16ns ? ?/sec
take stringview null values 1024 1.00 2.1±0.00µs ? ?/sec 1.03 2.1±0.01µs ? ?/sec
take stringview null values null indices 1024 1.00 2.4±0.01µs ? ?/sec 1.02 2.5±0.02µs ? ?/sec
```
</p>
</details>
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#issuecomment-3176786345
Thanks again @liamzwbao and @Dandandan and @jhorstmann
--
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
Re: [PR] Use `Vec` directly in builders [arrow-rs]
Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on code in PR #7984:
URL: https://github.com/apache/arrow-rs/pull/7984#discussion_r2227957793
##########
arrow-array/src/builder/generic_bytes_builder.rs:
##########
@@ -184,11 +186,11 @@ impl<T: ByteArrayType> GenericByteBuilder<T> {
let array_type = T::DATA_TYPE;
let array_builder = ArrayDataBuilder::new(array_type)
.len(self.len())
- .add_buffer(self.offsets_builder.finish())
- .add_buffer(self.value_builder.finish())
+ .add_buffer(Buffer::from_vec(std::mem::take(&mut self.offsets_builder)))
Review Comment:
Should be able to use `into()`
--
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