Fokko opened a new pull request, #9428: URL: https://github.com/apache/arrow-rs/pull/9428
# Which issue does this PR close? Resolves #9427 While going through the code, @scovich noticed that it allocates a `vec![false; n]` to be appended to the null buffer, which is not very efficent: ``` append_nulls: vec![false; n] (old) vs append_n_nulls (new) ┌─────────┬─────────────────┬──────────────────────┬─────────┐ │ n │ old (vec alloc) │ new (append_n_nulls) │ speedup │ ├─────────┼─────────────────┼──────────────────────┼─────────┤ │ 100 │ 82 ns │ 43 ns │ ~2x │ ├─────────┼─────────────────┼──────────────────────┼─────────┤ │ 1,000 │ 319 ns │ 47 ns │ ~7x │ ├─────────┼─────────────────┼──────────────────────┼─────────┤ │ 10,000 │ 2,540 ns │ 68 ns │ ~37x │ ├─────────┼─────────────────┼──────────────────────┼─────────┤ │ 100,000 │ 25,526 ns │ 293 ns │ ~87x │ └─────────┴─────────────────┴──────────────────────┴─────────┘ ``` # Rationale for this change MOAR efficient # What changes are included in this PR? Avoid allocating a `Vec`. # Are these changes tested? Existing tests # Are there any user-facing changes? Less memory consumption and a happy CPU -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
