zeroshade commented on code in PR #1237:
URL: https://github.com/apache/arrow-go/pull/1237#discussion_r3881886633


##########
arrow/array/booleanbuilder.go:
##########
@@ -135,9 +135,7 @@ func (b *BooleanBuilder) AppendValues(v []bool, valid 
[]bool) {
        }
 
        b.Reserve(len(v))
-       for i, vv := range v {
-               bitutil.SetBitTo(b.rawData, b.length+i, vv)
-       }
+       packBoolsToBitmap(b.rawData, b.length, v)

Review Comment:
   This regresses small `AppendValues` batches because `packBoolsToBitmap` adds 
setup overhead without packing a complete byte. Pre-reserved median results 
versus the exact base were: 1 value +35%, 2 values +23%, 3 values +15%, and 7 
values +14%; the new implementation becomes faster at 8 values. Please retain 
the previous `SetBitTo` loop for small slices and add small-batch benchmark 
coverage.



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