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


##########
arrow/array/binarybuilder.go:
##########
@@ -263,6 +268,12 @@ func (b *BinaryBuilder) DataCap() int { return 
b.values.capacity }
 // by checking the capacity and calling Resize if necessary.
 func (b *BinaryBuilder) Reserve(n int) {
        b.reserve(n, b.Resize)
+       if n > 0 {

Review Comment:
   This check now runs through `Reserve` for every scalar `Append`, 
`AppendNull`, and `AppendEmptyValue`. In an identical pre-reserved benchmark 
against the exact base, median `Append` time increased from 6.43 ns to 6.98 ns 
(+8.6%), and `AppendNull` increased from 3.96 ns to 4.68 ns (+18.4%). Please 
move the terminal-offset correction to the bulk/capacity-growth path so the 
scalar hot path remains unchanged, and add a scalar benchmark covering it.



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