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

   ### Rationale for this change
   
   Fixed-width builders currently implement `AppendNulls` by calling 
`AppendNull` for every value. Large batches repeatedly reserve capacity, update 
the validity bitmap, and update builder counters.
   
   ### What changes are included in this PR?
   
   - Reserve capacity once for a null batch.
   - Clear the validity range in bulk.
   - Update the length and null count once.
   - Advance fixed-size binary value storage once.
   - Keep the existing scalar path when appending one null.
   - Update both the numeric builder template and generated source.
   - Add shared correctness tests and benchmarks for representative fixed-width 
builders.
   
   This only changes `AppendNulls`. Empty-value appends are separate because 
their value bytes must also be zeroed.
   
   Apple M1 Pro results for 65,536 nulls with `-cpu=1`:
   
   | Builder | Before | After | Speedup | Allocs |
   | --- | ---: | ---: | ---: | ---: |
   | Int32 | 252 us | 68.2 us | 3.70x | 23 to 5 |
   | Int64 | 366 us | 169 us | 2.17x | 23 to 5 |
   | Decimal128 | 574 us | 259 us | 2.22x | 25 to 7 |
   | Timestamp | 424 us | 176 us | 2.41x | 24 to 6 |
   | Boolean | 178 us | 6.92 us | 25.7x | 19 to 5 |
   | FixedSizeBinary(16) | 606 us | 327 us | 1.85x | 28 to 7 |
   
   ### Are these changes tested?
   
   Yes.
   
   - `go test ./arrow/...`
   - `go test -race ./arrow/array`
   - `go vet -composites=false ./arrow/array`
   - Regenerated the numeric builders and verified there is no diff.
   - Cross-compiled the array tests for linux/amd64 and linux/s390x.
   
   ### Are there any user-facing changes?
   
   No.


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