fallintoplace opened a new pull request, #1185: URL: https://github.com/apache/arrow-go/pull/1185
### Rationale for this change Appending an explicit `[]bool` validity slice currently updates the bitmap and null count one value at a time. This is a noticeable part of `AppendValues` for narrow types. ### What changes are included in this PR? - handle the unaligned prefix and trailing values individually - pack aligned validity values eight at a time - count nulls once per packed byte - add coverage for all starting bit offsets, different lengths, and stale neighboring bits - add helper and builder benchmarks Benchmarks append 65,536 values on an Apple M1 Pro. Values are medians from three runs. | Benchmark | Before | After | Change | | --- | ---: | ---: | ---: | | Int8 / all valid | 68.9 us | 19.6 us | 3.51x | | Int8 / 50% null | 89.9 us | 20.4 us | 4.41x | | Int64 / all valid | 87.9 us | 31.7 us | 2.77x | | Int64 / 50% null | 103.0 us | 33.6 us | 3.06x | | Boolean / all valid | 212.0 us | 162.0 us | 1.31x | | Boolean / 50% null | 225.0 us | 163.3 us | 1.38x | | String / all valid | 538.1 us | 471.4 us | 1.14x | | String / 50% null | 553.9 us | 476.0 us | 1.16x | No allocations are added. ### Are these changes tested? Yes. - `go test ./arrow/...` - `go test -race ./arrow/array` - `go vet ./arrow/array` ### Are there any user-facing changes? No. This only changes how builder validity bitmaps are populated. -- 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]
