Commits


Ilya Biryukov authored and Andrew Lamb committed 6a1320604a2
ARROW-11913: [Rust] Improve performance of StringBuilder by delaying bitmap creation `PrimitiveBuilder<u8>` was performing a lot of unnecessary bit operations. One operation for each byte of each string one appends. Delaying the creation of null bitmap builder for `PrimitiveBuilder` significantly improves performance of `StringBuilder`. The optimization is also generally useful as the null bitmap is not stored if resulting arrays do not contain nulls. Results from the added benchmark on my machine are: ``` bench_primitive/bench_string time: [6.8971 ms 6.9123 ms 6.9335 ms] thrpt: [937.48 MiB/s 940.35 MiB/s 942.43 MiB/s] change: time: [-49.585% -49.395% -49.204%] (p = 0.00 < 0.05) thrpt: [+96.867% +97.610% +98.355%] Performance has improved. ``` Closes #9662 from ilya-biryukov/optstr Authored-by: Ilya Biryukov <iu.biryukov@gmail.com> Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>