fallintoplace opened a new pull request, #1188:
URL: https://github.com/apache/arrow-go/pull/1188

   ## Summary
   
   - reserve the full batch once in `BinaryBuilder.AppendNulls` and 
`AppendEmptyValues`
   - fill the repeated current offsets directly for both 32-bit and 64-bit 
offset buffers
   - update the validity bitmap and counters once per batch
   - add coverage and benchmarks for Binary, LargeBinary, String, and 
LargeString
   
   This follows the same batching shape used by [Arrow C++ binary 
builders](https://github.com/apache/arrow/blob/485499fd02ea2b0c323d67871fbe96aae4232504/cpp/src/arrow/array/builder_binary.h#L100-L140).
   
   ## Benchmark
   
   65,536 appended values, representative medians on darwin/arm64:
   
   | Builder | Operation | Before | After | Change |
   | --- | --- | ---: | ---: | ---: |
   | Binary | nulls | 403 us | 93 us | -77% |
   | LargeBinary | nulls | 475 us | 158 us | -67% |
   | String | nulls | 402 us | 85 us | -79% |
   | String | empty | 458 us | 84 us | -82% |
   | LargeString | nulls | 532 us | 159 us | -70% |
   | LargeString | empty | 517 us | 154 us | -70% |
   
   Allocations per build drop from 27 to 8 for 32-bit offsets and from 28 to 8 
for 64-bit offsets. Single-value performance stays about the same.
   
   ## Tests
   
   - `go test ./arrow/array -count=1`
   - `go test -race ./arrow/array -run 
TestBinaryBuilderBulkAppendNullsAndEmptyValues -count=1`
   - `go vet ./arrow/array`


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

Reply via email to