You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/05/11 17:08:27 UTC
[GitHub] [beam] damccorm commented on a diff in pull request #17613: [BEAM-14347] Add some benchmarks for generic registration
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
--
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@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org