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/03/09 16:03:30 UTC

[GitHub] [arrow] Dandandan commented on a change in pull request #9662: ARROW-11913: [Rust] Improve performance of StringBuilder

Dandandan commented on a change in pull request #9662:
URL: https://github.com/apache/arrow/pull/9662#discussion_r590502094



##########
File path: rust/arrow/src/array/builder.rs
##########
@@ -577,14 +579,15 @@ impl<T: ArrowPrimitiveType> PrimitiveBuilder<T> {
 
     /// Appends a value of type `T` into the builder
     pub fn append_value(&mut self, v: T::Native) -> Result<()> {
-        self.bitmap_builder.append(true);
+        self.bitmap_builder.as_mut().map(|b| b.append(true));
         self.values_builder.append(v);
         Ok(())
     }
 
     /// Appends a null slot into the builder
     pub fn append_null(&mut self) -> Result<()> {
-        self.bitmap_builder.append(false);
+        self.materialize_bitmap_builder();

Review comment:
       Could you also benchmark the case where there are nulls in the input? Wouldn't that be a bit slower now?




----------------------------------------------------------------
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