zeroshade commented on code in PR #13770:
URL: https://github.com/apache/arrow/pull/13770#discussion_r935771669


##########
go/arrow/array/list.go:
##########
@@ -181,29 +330,36 @@ func (b *ListBuilder) Release() {
        b.offsets.Release()
 }
 
-func (b *ListBuilder) appendNextOffset() {
-       b.offsets.Append(int32(b.values.Len()))
+func (b *listBuilder) appendNextOffset() {
+       b.appendOffsetVal(b.values.Len())

Review Comment:
   Yea, right now it's going through a function pointer. I don't know offhand 
whether or not the Go compiler would be able to inline this with the function 
pointer (though I can take a look at the generated assembly and see), my 
initial assumption would be that it's not going to inline this and will go 
through the function pointer each time.
   
   It was a decision I made to allow the code reuse at the expense of some 
performance in the builder.
   
   There are a lot of cases I would prefer to use go's generics for (like this 
one), but we're trying to maintain compatibility for Go versions latest-1 (ie: 
go1.17+) so I don't want to introduce usages of generics just yet until Go1.19 
is released.



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