jrmccluskey commented on a change in pull request #15196:
URL: https://github.com/apache/beam/pull/15196#discussion_r674185777
##########
File path: sdks/go/pkg/beam/runners/direct/gbk.go
##########
@@ -100,6 +114,68 @@ func (n *CoGBK) FinishBundle(ctx context.Context) error {
return n.Out.FinishBundle(ctx)
}
+func (n *CoGBK) mergeWindows() error {
+ sort.Slice(n.wins, func(i int, j int) bool {
+ return n.wins[i].MaxTimestamp() < n.wins[j].MaxTimestamp()
+ })
+ n.mergeMap = make(map[typex.Window]int)
Review comment:
Done. I figured using some memory to store the map was favorable to
slowing things down by needing a binary search implementation to assign the
original windows to the merged versions, but tweaking where that is kept to
make GC happen sooner is a reasonable improvement.
--
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]