You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/29 12:40:07 UTC
[GitHub] [arrow] jorgecarleitao commented on a change in pull request #9330: [Rust] [Experiment] [WIP]: Use SmallVec in ArrayData to optimize the common usecase of single-buffer arrays
jorgecarleitao commented on a change in pull request #9330:
URL: https://github.com/apache/arrow/pull/9330#discussion_r566793765
##########
File path: rust/arrow/src/array/data.rs
##########
@@ -225,11 +226,11 @@ pub struct ArrayData {
/// The buffers for this array data. Note that depending on the array types, this
/// could hold different kinds of buffers (e.g., value buffer, value offset buffer)
/// at different positions.
- buffers: Vec<Buffer>,
+ buffers: SmallVec<[Buffer; 1]>,
Review comment:
fyi, max is 3 including the null buffer, so max is 2 in this context. See `MutableDataArray`, where we use two buffers on the stack to avoid the overhead. When unused, a buffer takes something like a `usize` + a pointer.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org