[ 
https://issues.apache.org/jira/browse/BEAM-14347?focusedWorklogId=769202&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-769202
 ]

ASF GitHub Bot logged work on BEAM-14347:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/May/22 17:08
            Start Date: 11/May/22 17:08
    Worklog Time Spent: 10m 
      Work Description: damccorm commented on code in PR #17613:
URL: https://github.com/apache/beam/pull/17613#discussion_r870556965


##########
sdks/go/pkg/beam/register/register_test.go:
##########
@@ -672,3 +675,133 @@ func (fn *PartialCombiner2) AddInput(i int, c CustomType) 
int {
 func (fn *PartialCombiner2) MergeAccumulators(i1 int, i2 int) int {
        return i1 + i2
 }
+
+// Foo is a struct with a method for measuring method invocation
+// overhead for StructuralDoFns.
+type Foo struct {
+       A int
+}
+
+// ProcessElement is a method for measuring a baseline of structural dofn 
overhead.
+func (f *Foo) ProcessElement(b CustomType) int {
+       return f.A + b.val
+}
+
+func MakeMultiEdge(f *graph.DoFn) graph.MultiEdge {
+       return graph.MultiEdge{
+               DoFn: f,
+       }
+}
+
+type callerCustomTypeГint struct {

Review Comment:
   Good question - surprisingly yes it is. This is intentionally mirroring [the 
registration functions generated by the code 
generator](https://github.com/apache/beam/blob/51067c123204a4951de3cba858edc96da354292b/sdks/go/pkg/beam/x/debug/debug.shims.go#L113),
 the naming helps point in that direction even more





Issue Time Tracking
-------------------

    Worklog Id:     (was: 769202)
    Time Spent: 14.5h  (was: 14h 20m)

> [Go SDK] Allow users to optimize DoFns with a single generic registration 
> function
> ----------------------------------------------------------------------------------
>
>                 Key: BEAM-14347
>                 URL: https://issues.apache.org/jira/browse/BEAM-14347
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-go
>            Reporter: Danny McCormick
>            Assignee: Danny McCormick
>            Priority: P2
>          Time Spent: 14.5h
>  Remaining Estimate: 0h
>
> Right now, to optimize DoFn execution, users have to use the code generator. 
> This updates to allow them to use generics instead.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to