You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "brancz (via GitHub)" <gi...@apache.org> on 2023/08/30 08:26:27 UTC

[GitHub] [arrow] brancz opened a new pull request, #37455: MINOR: [Go] Don't recursively reserve in append to struct builder

brancz opened a new pull request, #37455:
URL: https://github.com/apache/arrow/pull/37455

   
   ### Rationale for this change
   
   Recursively reserving on every append is extremely expensive. This is not fundamentally necessary, it is meant to try to save CPU cycles, but in fact because it requires tons of dynamic dispatch (because of interfaces), when appending a lot even though you correctly reserved previously you will waste tons of CPU cycles.
   
   ### What changes are included in this PR?
   
   Only reserve space in the validity bitmap of the struct itself.
   
   ### Are these changes tested?
   
   Tests are passing and we've successfully deployed and validated the improvement on Polar Signals Cloud.
   
   ### Are there any user-facing changes?
   
   It's not an API change, but there is a slight change in behavior, which users should not notice since if reserving is still necessary for the children, then the children builder will perform it automatically. I believe this is only a positive improvement in every direction.
   
   cc @zeroshade 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] brancz commented on a diff in pull request #37455: MINOR: [Go] Don't recursively reserve in append to struct builder

Posted by "brancz (via GitHub)" <gi...@apache.org>.
brancz commented on code in PR #37455:
URL: https://github.com/apache/arrow/pull/37455#discussion_r1310548656


##########
go/arrow/array/struct.go:
##########
@@ -259,7 +259,7 @@ func (b *StructBuilder) Release() {
 }
 
 func (b *StructBuilder) Append(v bool) {
-	b.Reserve(1)
+	b.builder.reserve(1, b.resizeHelper)

Review Comment:
   Done!



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] conbench-apache-arrow[bot] commented on pull request #37455: MINOR: [Go] Don't recursively reserve in append to struct builder

Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #37455:
URL: https://github.com/apache/arrow/pull/37455#issuecomment-1703415212

   After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit 4ee6688b8f460df89fa29459f69bd3da4716b5d3.
   
   There were no benchmark performance regressions. 🎉
   
   The [full Conbench report](https://github.com/apache/arrow/runs/16432466360) has more details.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] brancz commented on a diff in pull request #37455: MINOR: [Go] Don't recursively reserve in append to struct builder

Posted by "brancz (via GitHub)" <gi...@apache.org>.
brancz commented on code in PR #37455:
URL: https://github.com/apache/arrow/pull/37455#discussion_r1310543715


##########
go/arrow/array/struct.go:
##########
@@ -259,7 +259,7 @@ func (b *StructBuilder) Release() {
 }
 
 func (b *StructBuilder) Append(v bool) {
-	b.Reserve(1)
+	b.builder.reserve(1, b.resizeHelper)

Review Comment:
   Sure thing!



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] zeroshade commented on a diff in pull request #37455: MINOR: [Go] Don't recursively reserve in append to struct builder

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #37455:
URL: https://github.com/apache/arrow/pull/37455#discussion_r1310519356


##########
go/arrow/array/struct.go:
##########
@@ -259,7 +259,7 @@ func (b *StructBuilder) Release() {
 }
 
 func (b *StructBuilder) Append(v bool) {
-	b.Reserve(1)
+	b.builder.reserve(1, b.resizeHelper)

Review Comment:
   toss a small comment here so we don't forget why we did this in the future?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] zeroshade merged pull request #37455: MINOR: [Go] Don't recursively reserve in append to struct builder

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade merged PR #37455:
URL: https://github.com/apache/arrow/pull/37455


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org