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/11 10:46:58 UTC

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

ilya-biryukov commented on a change in pull request #9662:
URL: https://github.com/apache/arrow/pull/9662#discussion_r592254747



##########
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:
       The change is within the noise threshold. That is exactly what I expected, there is enough code around the buidlers that adding an extra branch for conditionally creating the array does not make much difference.
   
   The benchmark results are:
   ```
   Before:
   bench_primitive_nulls/bench_primitive_nulls
                           time:   [4.5728 ms 4.5761 ms 4.5795 ms]
   
   After:
   bench_primitive_nulls/bench_primitive_nulls
                           time:   [4.5972 ms 4.6004 ms 4.6038 ms]
                           change: [+0.4255% +0.5290% +0.6284%] (p = 0.00 < 0.05)
                           Change within noise threshold.
   ```




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